{"name":"warehouse","version":"5.0.1","keywords":["database","json","db"],"author":{"url":"https://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"warehouse@5.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":"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":"4062c9c5d6c84f245532923a23ecb4b5441024a5","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-5.0.1.tgz","fileCount":78,"integrity":"sha512-5BQEQP56bPY+cqocTho4syazuGgSoyKd0y3PsS2j8tGN10HH+CEfJSIY+KUw9D0k4jaVEFMXLz0KqCiUzTYb8A==","signatures":[{"sig":"MEQCIGI/tmlnd7vQGlJjAwtHGUTWDjylCjWqtQH36oTkoRg7AiBNb3pCh44L2mXXDOi+oi2ACtVH1E5otk2kJtFIplxdGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":255844,"size":42860,"noattachment":false,"key":"/warehouse/-/warehouse-5.0.1.tgz"},"main":"dist/database","types":"./dist/database.d.ts","engines":{"node":">=14"},"gitHead":"e62b7b821253f033fc989aa1aeab728856861664","scripts":{"test":"mocha -r ts-node/register 'test/scripts/**/*.ts'","build":"tsc -b","clean":"tsc -b --clean","eslint":"eslint src test","pretest":"npm run clean && npm run build","typedoc":"typedoc --entryPointStrategy expand ./src","test-cov":"c8 --reporter=lcovonly --reporter=text-summary npm test","preeslint":"npm run clean && npm run build","prepublish ":"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":"20.10.0","dependencies":{"cuid":"^2.1.8","rfdc":"^1.3.0","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":"^9.0.0","chai":"^4.3.6","mocha":"^10.1.0","sinon":"^17.0.1","eslint":"^8.26.0","lodash":"^4.17.21","ts-node":"^10.9.1","typedoc":"^0.25.0","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","typedoc-plugin-rename-defaults":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/warehouse_5.0.1_1705208766718_0.8081313420828653","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":1705208766884,"_cnpm_publish_time":1705208766884,"dist-tags":{"latest":"7.0.0"}}