{"name":"warehouse","version":"6.0.0","keywords":["database","json","db"],"author":{"url":"https://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"warehouse@6.0.0","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":"jlhwung@gmail.com"},{"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":"27f59c24c205d779afe5c42bf969a1b7743ae3b2","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-6.0.0.tgz","fileCount":79,"integrity":"sha512-eOlhyPp5HC951QVDgAeculpSxvfum4UZAbqXSzocqbdiziTseFJFYxmhsKqrQ3wrwgtzPGgkVN2rPL31YLQ0SA==","signatures":[{"sig":"MEYCIQDkNkzUlSqGwgrs0gNppR7msZzJsbKFVip9oUwpEeJVYgIhAPK7JM5cH5uAARySiZnv0p9joL+V3C1tNIKF9+mCKmqQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261560,"size":43598,"noattachment":false,"key":"/warehouse/-/warehouse-6.0.0.tgz"},"main":"dist/database","types":"./dist/database.d.ts","engines":{"node":">=18"},"gitHead":"121036fcba3910c2a8bfc9dcfca5d9c422df5c5f","scripts":{"test":"mocha -r ts-node/register 'test/scripts/**/*.ts'","build":"tsc -b","clean":"tsc -b --clean","eslint":"eslint src test","typedoc":"typedoc --entryPointStrategy expand ./src","test-cov":"c8 --reporter=lcovonly --reporter=text-summary npm test","prepublishOnly":"npm install && npm run clean && npm run build"},"_npmUser":{"name":"yoshinorin","email":"yoshinorin.net@outlook.com"},"repository":{"url":"git+https://github.com/hexojs/warehouse.git","type":"git"},"_npmVersion":"10.2.4","description":"Simple JSON-based database","directories":{"lib":"./dist"},"_nodeVersion":"23.6.0","dependencies":{"rfdc":"^1.3.0","nanoid":"^3.3.7","bluebird":"^3.7.2","hexo-log":"^4.0.1","through2":"^4.0.2","jsonparse":"^1.3.1","graceful-fs":"^4.2.10","is-plain-object":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","chai":"^4.3.6","mocha":"^11.0.1","sinon":"^19.0.2","eslint":"^8.26.0","lodash":"^4.17.21","ts-node":"^10.9.1","typedoc":"^0.27.2","typescript":"^5.0.3","@types/chai":"^4.3.3","@types/node":"^18.11.7","@types/mocha":"^10.0.0","@types/sinon":"^17.0.3","@types/bluebird":"^3.5.37","@types/through2":"^2.0.36","chai-as-promised":"^7.1.1","@types/jsonstream":"^0.8.30","@types/graceful-fs":"^4.1.5","eslint-config-hexo":"^5.0.0","@types/chai-as-promised":"^8.0.1","typedoc-plugin-rename-defaults":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/warehouse_6.0.0_1737116368339_0.36665223178534934","host":"s3://npm-registry-packages-npm-production"},"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":1737116368535,"_cnpm_publish_time":1737116368535,"dist-tags":{"latest":"7.0.0"}}