{"name":"warehouse","version":"4.0.2","keywords":["database","json","db"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"warehouse@4.0.2","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":"5ea59381c59e2187bcd77d25d8a628b1e1ffc53d","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-4.0.2.tgz","fileCount":27,"integrity":"sha512-GixS7SolBGu81rnxYM6bScxdElLM97Jx/kr0a6B6PGBWFqvHeuWFj7QbgEX1YWZSxiJt/aR6dBVQKC/PvvihdQ==","signatures":[{"sig":"MEQCIA+O1WuIiInk5+TeokVkUr+ZB/lz0yzkduB3h7uVP11CAiAk3C+uy4fXR2+D1OlIFMyCnJk9ihRQAmrUbHhmd5W1mw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi41qZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3cg//Sm4Ohob9xt9WLTo6wiBPeca7Xnxf955uO4gQuCHCV06xauG2\r\nnAATpRXpKmIHn46jBlgmLWqGLy2bbocmDybjd1OOuImVHKCAL1yZrPEsZ4g8\r\nkr2rpuqXogNHjZyBkLfhZl5sExi5EOjZLSOMb1Mz6NhituR57e0+3AG/MkRZ\r\npspqmMNVejs92EHunXEbAE6tiJ6sHB2uw4ovn0nGB0dmO+6L2wzISqGqb5oc\r\n4fjePCeZHzErJnW+4OeHZccH5JJdVd0vnthiNVjFd8cel30n4Drl7/IG1PVf\r\niLhBVK5KB0RBObcCxB+pO8BtShNAYiEqIuGvV/7qu7ONy2suMqL82xFeUzEa\r\nbf4/0RexOZdgsEZOWcini5Z3PzYh/O84rV8CeyA1SJqV+0PjLdhQrPp/n7pk\r\noJF61jAwZK18Hp5o7lh1deRhR1LTuF0Itr+ur4/q8C/lw6M3qqgp7yf2XSDZ\r\nEIke7kek2X3q4whdc972FRxXBa7Rb01m7Z25ddv5IiQS0D9WtaadMNVK/ACn\r\nwMBOGSjSFcOrF3qIGWQ3eKlGVvt54waqGo/pL3avtRSl0DqRGRFD5PdQlMjo\r\npnnVk4LoKw/W2Ahi5L2f0Mszfiby89Gg8tLaTaH+tt+X5UqK7WhVBvhI8vX8\r\nEa8vQOA7pyORssPgONnzgooRMfLMdUuWsV4=\r\n=yeI+\r\n-----END PGP SIGNATURE-----\r\n","size":19070,"noattachment":false,"key":"/warehouse/-/warehouse-4.0.2.tgz"},"main":"lib/database","engines":{"node":">=10.13.0"},"gitHead":"4db1c4fd0a100c3a049dc98a18f768835f4a6cb8","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":"18.6.0","dependencies":{"cuid":"^2.1.4","rfdc":"^1.1.4","bluebird":"^3.2.2","hexo-log":"^3.0.0","through2":"^4.0.2","jsonparse":"^1.3.1","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.2_1659067033233_0.6876758188483196","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":1659067033402,"_cnpm_publish_time":1659067033402,"dist-tags":{"latest":"7.0.0"}}