{"name":"warehouse","version":"2.2.0","keywords":["database","json","db"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"warehouse@2.2.0","maintainers":[{"name":"tommy351","email":"tommy351@gmail.com"}],"homepage":"https://github.com/tommy351/warehouse#readme","bugs":{"url":"https://github.com/tommy351/warehouse/issues"},"dist":{"shasum":"5d09d64942992be667d8f7c86a09c2b8aea04062","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-2.2.0.tgz","integrity":"sha512-axyo83DpdZabmCsiipkHYKnwl6ull2Vv7fqxMnV8KOQLdiJKffn9W+B3Yac7QVWzBE56Q6B6j2cIY1k2gc10PA==","signatures":[{"sig":"MEUCIBIe4c7u27Ht1yaHfEhSNnw4hRx7731Qxp93/qBdjB1NAiEAzhTicVj19b5MksHJtz3FbSZc85hdGPESOg38yiLNpbg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":21282,"noattachment":false,"key":"/warehouse/-/warehouse-2.2.0.tgz"},"main":"lib/database","_from":".","_shasum":"5d09d64942992be667d8f7c86a09c2b8aea04062","gitHead":"e46a663a6e2d2fc00579a0d80412e976ac5da73f","scripts":{"jscs":"jscs .","test":"mocha test/index.js","jsdoc":"jsdoc --configure .jsdoc.json","eslint":"eslint .","test-cov":"istanbul cover --print both _mocha -- test/index.js"},"_npmUser":{"name":"tommy351","email":"tommy351@gmail.com"},"repository":{"url":"git+https://github.com/tommy351/warehouse.git","type":"git"},"_npmVersion":"3.7.1","description":"Simple JSON-based database","directories":{"lib":"./lib"},"_nodeVersion":"4.3.0","dependencies":{"cuid":"~1.3.8","lodash":"^4.2.1","bluebird":"^3.2.2","JSONStream":"^1.0.7","graceful-fs":"^4.1.3","is-plain-object":"^2.0.1"},"devDependencies":{"chai":"^3.5.0","jscs":"^2.9.0","jsdoc":"^3.4.0","mocha":"^2.4.5","sinon":"^1.17.3","eslint":"^1.10.3","minami":"^1.1.1","istanbul":"^0.4.2","chai-as-promised":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/warehouse-2.2.0.tgz_1455433071736_0.9035211408045143","host":"packages-9-west.internal.npmjs.com"},"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":1455433073638,"_cnpm_publish_time":1455433073638,"dist-tags":{"latest":"7.0.0"}}