UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

132 lines (131 loc) 5.89 kB
{ "_args": [ [ { "raw": "map-age-cleaner@^0.1.1", "scope": null, "escapedName": "map-age-cleaner", "name": "map-age-cleaner", "rawSpec": "^0.1.1", "spec": ">=0.1.1 <0.2.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/mem" ] ], "_from": "map-age-cleaner@^0.1.1", "_hasShrinkwrap": false, "_id": "map-age-cleaner@0.1.2", "_location": "/map-age-cleaner", "_nodeVersion": "8.9.4", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/map-age-cleaner_0.1.2_1536226801733_0.6184748509416897" }, "_npmUser": { "name": "samverschueren", "email": "sam.verschueren@gmail.com" }, "_npmVersion": "5.6.0", "_phantomChildren": {}, "_requested": { "raw": "map-age-cleaner@^0.1.1", "scope": null, "escapedName": "map-age-cleaner", "name": "map-age-cleaner", "rawSpec": "^0.1.1", "spec": ">=0.1.1 <0.2.0", "type": "range" }, "_requiredBy": [ "/mem" ], "_resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", "_shasum": "098fb15538fd3dbe461f12745b0ca8568d4e3f74", "_shrinkwrap": null, "_spec": "map-age-cleaner@^0.1.1", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/mem", "author": { "name": "Sam Verschueren", "email": "sam.verschueren@gmail.com", "url": "github.com/SamVerschueren" }, "bugs": { "url": "https://github.com/SamVerschueren/map-age-cleaner/issues" }, "dependencies": { "p-defer": "^1.0.0" }, "description": "Automatically cleanup expired items in a Map", "devDependencies": { "@types/delay": "^2.0.1", "@types/node": "^10.7.1", "ava": "^0.25.0", "codecov": "^3.0.0", "del-cli": "^1.1.0", "delay": "^3.0.0", "nyc": "^12.0.0", "tslint": "^5.11.0", "tslint-xo": "^0.9.0", "typescript": "^3.0.1" }, "directories": {}, "dist": { "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", "shasum": "098fb15538fd3dbe461f12745b0ca8568d4e3f74", "tarball": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", "fileCount": 5, "unpackedSize": 8169, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkPXyCRA9TVsSAnZWagAA6moP/3gRQBJ7IAKGvaecTAZn\nRXAeXIY6pdFqJHIEncCR/4TraTHiHfzLPcMGsZks/1hb2D65DLWtBOA0uNQT\nOqRLZclxJIOw35m8cEpbpSgqKBcQKz1VKB2dEk2MgXFbLHSOvO+fhWMbP6y+\nONSR76mpe6MgbhTdKNqsm8bbKg+mLQA8/wnpGhEG6pN/kIWHAI2UAgvxi0sF\nSLxcRJfvOxoj16SATHOzH26EntV8HqQYsZ23Y6q8PfG6Dpdz5czLgkfQ5xC7\nK5T3/Ce5Hu/7Bi8VXHpQFfY7D1/AkoZpzTdU8XziZ4yjg93OxE7AnILnvSqP\n6UK7Sgk/eRkWMjIisg7PRudpkSILeaWZH2uXhL2/ASnoQdeoMpSRd30K20EQ\n6a7AWS0nVJNNSgZhCxQ6IWAgzeZRQTtbDo6/3R9SooiGK7edI9KJIw5vR+mx\nc8QMg8P6hp4TcI0klHmtNW8VdzN2Z4ZU1M3ZdZRuDaNPmxgSeP3N+G0+6e0N\nc2BTF6tBe5r6pBLWS2g1BcXK3azCUd/Nhaxarwa62gf8UnuMD86kzdJ/GhZn\n2XTcNq94+8zNd6QdMmf3OApVmyVMRMHhMt1oZWnQnaIszKCEZo6Wyk8aZHgp\nWI/B6MBYDvRsh8TT9TQcwO9Z60x57oipvaGBVCQmt0LCz6DGjZuVGNSgMcV2\nzroX\r\n=oSzB\r\n-----END PGP SIGNATURE-----\r\n" }, "engines": { "node": ">=6" }, "files": [ "dist/index.js", "dist/index.d.ts" ], "gitHead": "e6cb1808735f53e460ef03f8defe8a2785dcfa1d", "homepage": "https://github.com/SamVerschueren/map-age-cleaner#readme", "keywords": [ "map", "age", "cleaner", "maxage", "expire", "expiration", "expiring" ], "license": "MIT", "main": "dist/index.js", "maintainers": [ { "name": "samverschueren", "email": "sam.verschueren@gmail.com" } ], "name": "map-age-cleaner", "nyc": { "exclude": [ "dist/test.js" ] }, "optionalDependencies": {}, "readme": "# map-age-cleaner\n\n[![Build Status](https://travis-ci.org/SamVerschueren/map-age-cleaner.svg?branch=master)](https://travis-ci.org/SamVerschueren/map-age-cleaner) [![codecov](https://codecov.io/gh/SamVerschueren/map-age-cleaner/badge.svg?branch=master)](https://codecov.io/gh/SamVerschueren/map-age-cleaner?branch=master)\n\n> Automatically cleanup expired items in a Map\n\n\n## Install\n\n```\n$ npm install map-age-cleaner\n```\n\n\n## Usage\n\n```js\nimport mapAgeCleaner from 'map-age-cleaner';\n\nconst map = new Map([\n\t['unicorn', {data: '🦄', maxAge: Date.now() + 1000}]\n]);\n\nmapAgeCleaner(map);\n\nmap.has('unicorn');\n//=> true\n\n// Wait for 1 second...\n\nmap.has('unicorn');\n//=> false\n```\n\n> **Note**: Items have to be ordered ascending based on the expiry property. This means that the item which will be expired first, should be in the first position of the `Map`.\n\n\n## API\n\n### mapAgeCleaner(map, [property])\n\nReturns the `Map` instance.\n\n#### map\n\nType: `Map`\n\nMap instance which should be cleaned up.\n\n#### property\n\nType: `string`<br>\nDefault: `maxAge`\n\nName of the property which olds the expiry timestamp.\n\n\n## Related\n\n- [expiry-map](https://github.com/SamVerschueren/expiry-map) - A `Map` implementation with expirable items\n- [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys\n- [mem](https://github.com/sindresorhus/mem) - Memoize functions\n\n\n## License\n\nMIT © [Sam Verschueren](https://github.com/SamVerschueren)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/SamVerschueren/map-age-cleaner.git" }, "scripts": { "build": "npm run clean && tsc", "clean": "del-cli dist", "lint": "tslint --format stylish --project .", "prepublishOnly": "npm run build", "pretest": "npm run build -- --sourceMap", "test": "npm run lint && nyc ava dist/test.js" }, "sideEffects": false, "typings": "dist/index.d.ts", "version": "0.1.2" }