{"name":"warehouse","version":"7.0.0","description":"Simple JSON-based database","main":"dist/database","directories":{"lib":"./dist"},"scripts":{"prepublishOnly":"npm install && npm run clean && npm run build","build":"tsc -b","clean":"tsc -b --clean","eslint":"eslint src test","test":"mocha -r ts-node/register 'test/scripts/**/*.ts'","test-cov":"c8 --reporter=lcovonly --reporter=text-summary npm test","typedoc":"typedoc --entryPointStrategy expand ./src"},"repository":{"type":"git","url":"git+https://github.com/hexojs/warehouse.git"},"keywords":["database","json","db"],"author":{"name":"Tommy Chen","email":"tommy351@gmail.com","url":"https://zespia.tw"},"license":"MIT","dependencies":{"bluebird":"^3.7.2","graceful-fs":"^4.2.10","hexo-log":"^4.0.1","is-plain-object":"^5.0.0","jsonparse":"^1.3.1","nanoid":"^3.3.7","rfdc":"^1.3.0","through2":"^4.0.2"},"devDependencies":{"@types/bluebird":"^3.5.37","@types/chai":"^4.3.3","@types/chai-as-promised":"^8.0.1","@types/graceful-fs":"^4.1.5","@types/jsonstream":"^0.8.30","@types/mocha":"^10.0.0","@types/node":"^18.11.7","@types/sinon":"^17.0.3","@types/through2":"^2.0.36","c8":"^10.1.3","chai":"^4.3.6","chai-as-promised":"^7.1.1","eslint":"^9.17.0","eslint-config-hexo":"^6.0.0","lodash":"^4.17.21","mocha":"11.0.2","sinon":"^19.0.2","ts-node":"^10.9.1","typedoc":"^0.27.2","typedoc-plugin-rename-defaults":"^0.7.0","typescript":"^5.0.3"},"engines":{"node":">=18"},"gitHead":"0408921b1948882c07fe0e02d0023ebd35e24d5b","types":"./dist/database.d.ts","_id":"warehouse@7.0.0","bugs":{"url":"https://github.com/hexojs/warehouse/issues"},"homepage":"https://github.com/hexojs/warehouse#readme","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-YfoIM8cRvf7Zu33R1ATcsbGGz5uwrL6c5tbg5sAHLDzogbeOQPFfz/zuDiOgWYiU/pScCkev6mJ8RX60ncLswQ==","shasum":"4a8840353ddbd0644eaae9fdd45cb891aad4bdf0","tarball":"http://registry-npm.ywwl.com/warehouse/download/warehouse-7.0.0.tgz","fileCount":79,"unpackedSize":264842,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/warehouse@7.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCHwttlqOTAaZTUV+hWbd97kt3H99Q9DoK1mnyCGaDYwgIgZAhrV8PgSeovetKGZOEEtn6zrJcztPH5u6gx/CmPy2Y="}],"size":44431,"noattachment":false,"key":"/warehouse/-/warehouse-7.0.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:43635235-a679-4482-b9d4-14678b795563"}},"maintainers":[{"name":"abnerchou","email":"hi@abnerchou.me"},{"name":"tommy351","email":"tommy351@gmail.com"},{"name":"jlhwung","email":"jlhwung@gmail.com"},{"name":"tomap","email":"piartt@gmail.com"},{"name":"yoshinorin","email":"yoshinorin.net@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/warehouse_7.0.0_1786628092835_0.8214231448072409"},"_hasShrinkwrap":false,"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":1786628092961,"_cnpm_publish_time":1786628092961,"dist-tags":{"latest":"7.0.0"}}