{
  "_args": [
    [
      {
        "raw": "flat-cache@^1.2.1",
        "scope": null,
        "escapedName": "flat-cache",
        "name": "flat-cache",
        "rawSpec": "^1.2.1",
        "spec": ">=1.2.1 <2.0.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/file-entry-cache"
    ]
  ],
  "_from": "flat-cache@>=1.2.1 <2.0.0",
  "_id": "flat-cache@1.3.0",
  "_inCache": true,
  "_location": "/flat-cache",
  "_nodeVersion": "6.9.1",
  "_npmOperationalInternal": {
    "host": "s3://npm-registry-packages",
    "tmp": "tmp/flat-cache-1.3.0.tgz_1506460157624_0.9121717647649348"
  },
  "_npmUser": {
    "name": "royriojas",
    "email": "royriojas@gmail.com"
  },
  "_npmVersion": "3.10.8",
  "_phantomChildren": {},
  "_requested": {
    "raw": "flat-cache@^1.2.1",
    "scope": null,
    "escapedName": "flat-cache",
    "name": "flat-cache",
    "rawSpec": "^1.2.1",
    "spec": ">=1.2.1 <2.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/file-entry-cache"
  ],
  "_resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
  "_shasum": "d3030b32b38154f4e3b7e9c709f490f7ef97c481",
  "_shrinkwrap": null,
  "_spec": "flat-cache@^1.2.1",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/file-entry-cache",
  "author": {
    "name": "Roy Riojas",
    "url": "http://royriojas.com"
  },
  "bugs": {
    "url": "https://github.com/royriojas/flat-cache/issues"
  },
  "changelogx": {
    "ignoreRegExp": [
      "BLD: Release",
      "DOC: Generate Changelog",
      "Generated Changelog"
    ],
    "issueIDRegExp": "#(\\d+)",
    "commitURL": "https://github.com/royriojas/flat-cache/commit/{0}",
    "authorURL": "https://github.com/{0}",
    "issueIDURL": "https://github.com/royriojas/flat-cache/issues/{0}",
    "projectName": "flat-cache"
  },
  "dependencies": {
    "circular-json": "^0.3.1",
    "del": "^2.0.2",
    "graceful-fs": "^4.1.2",
    "write": "^0.2.1"
  },
  "description": "A stupidly simple key/value storage using files to persist some data",
  "devDependencies": {
    "chai": "^3.2.0",
    "changelogx": "^1.0.18",
    "esbeautifier": "^6.1.8",
    "eslinter": "^3.2.1",
    "glob-expand": "^0.1.0",
    "istanbul": "^0.3.19",
    "mocha": "^2.3.2",
    "precommit": "^1.1.5",
    "prepush": "^3.1.4",
    "proxyquire": "^1.7.2",
    "sinon": "^1.16.1",
    "sinon-chai": "^2.8.0",
    "watch-run": "^1.2.2"
  },
  "directories": {},
  "dist": {
    "shasum": "d3030b32b38154f4e3b7e9c709f490f7ef97c481",
    "tarball": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "files": [
    "cache.js",
    "utils.js"
  ],
  "gitHead": "f24515a154833853feb825b62149ea48ba7e226a",
  "homepage": "https://github.com/royriojas/flat-cache#readme",
  "keywords": [
    "json cache",
    "simple cache",
    "file cache",
    "key par",
    "key value",
    "cache"
  ],
  "license": "MIT",
  "main": "cache.js",
  "maintainers": [
    {
      "name": "royriojas",
      "email": "royriojas@gmail.com"
    }
  ],
  "name": "flat-cache",
  "optionalDependencies": {},
  "precommit": [
    "npm run verify --silent"
  ],
  "prepush": [
    "npm run verify --silent"
  ],
  "readme": "# flat-cache\n> A stupidly simple key/value storage using files to persist the data\n\n[![NPM Version](http://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache)\n[![Build Status](http://img.shields.io/travis/royriojas/flat-cache.svg?style=flat)](https://travis-ci.org/royriojas/flat-cache)\n\n## install\n\n```bash\nnpm i --save flat-cache\n```\n\n## Usage\n\n```js\nvar flatCache = require('flat-cache')\n// loads the cache, if one does not exists for the given\n// Id a new one will be prepared to be created\nvar cache = flatCache.load('cacheId');\n\n// sets a key on the cache\ncache.setKey('key', { foo: 'var' });\n\n// get a key from the cache\ncache.getKey('key') // { foo: 'var' }\n\n// fetch the entire persisted object\ncache.all() // { 'key': { foo: 'var' } }\n\n// remove a key\ncache.removeKey('key'); // removes a key from the cache\n\n// save it to disk\ncache.save(); // very important, if you don't save no changes will be persisted.\n// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys\n\n// loads the cache from a given directory, if one does\n// not exists for the given Id a new one will be prepared to be created\nvar cache = flatCache.load('cacheId', path.resolve('./path/to/folder'));\n\n// The following methods are useful to clear the cache\n// delete a given cache\nflatCache.clearCacheById('cacheId') // removes the cacheId document if one exists.\n\n// delete all cache\nflatCache.clearAll(); // remove the cache directory\n```\n\n## Motivation for this module\n\nI needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make\na script that will beutify files with `esformatter` only execute on the files that were changed since the last run.\nTo make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value`\nstorage was needed and Bam! this module was born.\n\n## Important notes\n- If no directory is especified when the `load` method is called, a folder named `.cache` will be created\n  inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you\n  might want to ignore the default `.cache` folder, or specify a custom directory.\n- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references\n- All the changes to the cache state are done to memory\n- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module\n  intentionally dumb and simple\n- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call\n  like: `cache.save( true /* noPrune */ )`.\n\n## License\n\nMIT\n\n## Changelog\n\n[changelog](./changelog.md)\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/royriojas/flat-cache.git"
  },
  "scripts": {
    "autofix": "npm run beautify && npm run eslint-fix",
    "beautify": "esbeautifier 'cache.js' 'test/specs/**/*.js'",
    "beautify-check": "npm run beautify -- -k",
    "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v",
    "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v",
    "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v",
    "changelog": "changelogx -f markdown -o ./changelog.md",
    "check": "npm run beautify-check && npm run eslint",
    "cover": "istanbul cover test/runner.js html text-summary",
    "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify",
    "eslint": "eslinter 'cache.js' 'utils.js' 'specs/**/*.js'",
    "eslint-fix": "npm run eslint -- --fix",
    "install-hooks": "prepush install && changelogx install-hook && precommit install",
    "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify",
    "pre-v": "npm run verify",
    "test": "npm run verify --silent",
    "test:cache": "mocha -R spec test/specs",
    "verify": "npm run check && npm run test:cache",
    "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary"
  },
  "version": "1.3.0"
}
