{"name":"warehouse","version":"4.0.1","keywords":["database","json","db"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"warehouse@4.0.1","maintainers":[{"name":"ertrzyiks","email":"mateusz.derks@gmail.com"},{"name":"abnerchou","email":"hi@abnerchou.me"},{"name":"tommy351","email":"tommy351@gmail.com"},{"name":"hexobot","email":"hexojs@gmail.com"},{"name":"jlhwung","email":"i@jhuang.me"},{"name":"tomap","email":"piartt@gmail.com"},{"name":"curben","email":"bushedge@protonmail.com"},{"name":"yoshinorin","email":"yoshinorin.net@outlook.com"}],"homepage":"https://github.com/hexojs/warehouse#readme","bugs":{"url":"https://github.com/hexojs/warehouse/issues"},"dist":{"shasum":"4d552b2635a2412ee0970c97e3bf12986b041e61","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-4.0.1.tgz","fileCount":26,"integrity":"sha512-rFJYdHlk2C+pKAoV4Nlptb+b7nmBN5QOg8VkQVNMbK7jf/lDctaUF9nNehZqVoarDWS74nMpTWVDhWecWwoqQw==","signatures":[{"sig":"MEQCICpaP8NVgTJwC+7PSW6/k5DomqBLoFkhSHoT/qquYLXUAiBha6Bj/X5sQPKm5eLlWH/r/40U9ST8mwN0KVEl/bytUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWAiDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogNw/8CxHk4SjXHnw4PgL80OxJnf4iYf5Q8MFyTocFvADnccSfA0t1\r\nySy0Cj8MCgMsqN838iRBoeDOqH/iTHLPDWnSJytjnsPRnJHxPGjt43N7kpmD\r\n36esa5ohNFQu7/p8K1isUKz/sGV1KsVfjSJPDsBzVZ7iik6dPFAmVSRweGZK\r\nOW/iJPKCGOCzDrr6uWCWgmC2GaUaUAU8GM0EBR+6cgDbHAUlRqw9eK1hVEWS\r\nXvfNyNx4zXr0PSwf8YbJrhdzsZMNwPfJOvjpdZNG4z0Or4gMyBXQFAhuxo2k\r\nRs0NhHzHHiya9vCfzkbHUNV4jk7DH3i9HxlXpIhUVCJl/Zs9o59wiZQULx9Z\r\ntFvR3rjabrPZuebbM7AQbg4Ml6RuBCsd/+KTyuqLrMiL5Sw+s4K4V9iB3waI\r\nfYGwc6LwzpO8lN9BvW+mlf6Jf/VOE1zsneMsvGVeErNy1oMZFOOiqsPOaG2R\r\n8nokOup03/rHDOQsN+HXHyD43ckP4r27w0JxtEAahH/5McohprUU4+xEdK9O\r\nV8uNYF0JuVfaQQTiMe6RwFxgil3FvUx60rK4VMDWUOWgYOCbT/2Ob9jmMTp1\r\nOx9Aut8vqSZVs5fO5ouNdDCDnM0F7WVTffzu4AQCPOZAaAYUhn/uwMlNrJUQ\r\nbYSugTdPyEIan2TFbFpc62sHkLgI6iqyOMo=\r\n=+Z99\r\n-----END PGP SIGNATURE-----\r\n","size":17752,"noattachment":false,"key":"/warehouse/-/warehouse-4.0.1.tgz"},"main":"lib/database","engines":{"node":">=10.13.0"},"gitHead":"711bb1f030136578c5900f0d391cea2d1eacea5a","scripts":{"test":"mocha \"test/scripts/**/*.js\"","jsdoc":"jsdoc --configure .jsdoc.json","eslint":"eslint lib test","test-cov":"nyc --reporter=lcovonly --reporter=text-summary npm test"},"_npmUser":{"name":"yoshinorin","email":"yoshinorin.net@outlook.com"},"repository":{"url":"git+https://github.com/hexojs/warehouse.git","type":"git"},"_npmVersion":"8.4.0","description":"Simple JSON-based database","directories":{"lib":"./lib"},"_nodeVersion":"16.8.0","dependencies":{"cuid":"^2.1.4","rfdc":"^1.1.4","bluebird":"^3.2.2","hexo-log":"^3.0.0","JSONStream":"^1.0.7","graceful-fs":"^4.1.3","is-plain-object":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.0","chai":"^4.2.0","jsdoc":"^3.4.0","mocha":"^9.2.0","sinon":"^9.0.2","eslint":"^8.1.0","lodash":"^4.17.15","minami":"^1.1.1","chai-as-promised":"^7.1.1","eslint-config-hexo":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/warehouse_4.0.1_1649936514933_0.16225958558107956","host":"s3://npm-registry-packages"},"readme":"# Warehouse\n\n![Tester](https://github.com/hexojs/warehouse/workflows/.github/workflows/ci.yml/badge.svg)\n![Pages Deployer](https://github.com/hexojs/warehouse/workflows/.github/workflows/pages.yml/badge.svg)\n[![NPM version](https://badge.fury.io/js/warehouse.svg)](https://www.npmjs.com/package/warehouse)\n[![Coverage Status](https://coveralls.io/repos/github/hexojs/warehouse/badge.svg?branch=master)](https://coveralls.io/github/hexojs/warehouse?branch=master)\n\nA JSON database with Models, Schemas, and a flexible querying interface. It powers the wildly successful static site generator [Hexo](https://hexo.io).\n\n## Installation\n\n``` bash\n$ npm install warehouse\n```\n\n## 3.0 BREAKING CHANGE\n\nIn `warehouse@3`, the constructor has been changed from function declaration to `class` declaration or definition by `class` expression.\nDerived classes of classes defined by `class` declarations and `class` expressions must also be defined in `class` declaration, `class` expression.\nAnyone who created their own SchemaType will need to change.\n\n``` js\nconst SchemaType = require('warehouse/schematype');\n\nclass MySchemaType extends SchemaType {\n  constructor(name, options = {}) {\n    super(name, Object.assign({ foo: 'foo' }, options));\n  }\n}\n```\n\nIt changes to a class declaration or a class expression, but it does not need to deal with other than the definition of the constructor.\n\n``` js\n// It work!\n\nMySchemaType.prototype.cast = function (value, data) {\n  let result = SchemaType.prototype.cast.call(this, value, data);\n  return result ? result : '';\n}\n```\n\n## Usage\n\n``` js\nvar Database = require('warehouse');\nvar db = new Database();\n\nvar Post = db.model('posts', {\n  title: String,\n  created: {type: Date, default: Date.now}\n});\n\nPost.insert({\n  title: 'Hello world'\n}).then(function(post){\n  console.log(post);\n});\n```\n\n+ [API documentation](https://hexojs.github.io/warehouse/)\n+ [Examples of `Model`, `Schema`, and `SchemaType`](https://github.com/hexojs/hexo/tree/master/lib/models)\n+ [More examples in `./test/scripts`](./test/scripts)\n\n## Test\n\n``` bash\n$ npm test\n```","publish_time":1649936515097,"_cnpm_publish_time":1649936515097,"dist-tags":{"latest":"7.0.0"}}