项目作者: tiaanduplessis

项目描述 :
Express-style in-memory cache middleware
高级语言: JavaScript
项目地址: git://github.com/tiaanduplessis/moola-memory.git
创建时间: 2017-07-30T10:55:54Z
项目社区:https://github.com/tiaanduplessis/moola-memory

开源协议:MIT License

下载


💰 moola-memory


Express-style in-memory cache middleware










Built with ❤︎ by tiaanduplessis and contributors

Table of Contents


Table of Contents
  • Install

  • Usage

  • Contribute

  • License

  • Install

    1. $ npm install moola-memory
    2. # OR
    3. $ yarn add moola-memory

    Usage

    1. const express = require('express')
    2. const app = express()
    3. const cache = require('moola-memory')
    4. app.use(cache(duration: 5 // Duration to cache. Defaults to 30s))
    5. app.get('/', (req, res) => {
    6. res.sendCached({test: true}) // The body will now be cached for 5 seconds
    7. })
    8. app.listen(8989)

    Contributing

    Contributions are welcome!

    1. Fork it.
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

    Or open up a issue.

    License

    Licensed under the MIT License.