{"_id":"@aaryankh/dbapp","_rev":"1-ca06c7f935a2ccb759cf1c3d1f96022d","name":"@aaryankh/dbapp","dist-tags":{"latest":"1.0.2-p1"},"versions":{"1.0.2":{"name":"@aaryankh/dbapp","version":"1.0.2","decription":"A Local JSON-Based Database Application","main":"./dist/test/test.js","author":{"name":"AaryanKh"},"license":"MIT","scripts":{"start":"node ."},"dependencies":{"@types/node":"^18.0.0"},"repository":{"type":"git","url":"git+https://github.com/AaryanKhClasses/DatabaseApp.git"},"gitHead":"24e478c080fc8cfd80719f7cf91d62b8215e5b5f","description":"---","bugs":{"url":"https://github.com/AaryanKhClasses/DatabaseApp/issues"},"homepage":"https://github.com/AaryanKhClasses/DatabaseApp#readme","_id":"@aaryankh/dbapp@1.0.2","_nodeVersion":"18.0.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-eRd2NrlvOQYvlBIJzUIZjta6+Jh3h15AJhYYptpBbDwBBBXpgHAt6EJlFJNpLR8aEoiZZ9ib8NiLuCpZBxcXWg==","shasum":"a7c611f23f6097ba383a19c6a595fc7238905968","tarball":"https://registry.npmjs.org/@aaryankh/dbapp/-/dbapp-1.0.2.tgz","fileCount":9,"unpackedSize":27003,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF1jEFRRmEETTglFThHEJnIFLTK4B7IUjgPRryNWiVXgIhAIQNDd4yKN20R5HuMPa/emvDho/WPrGqumHUR9xs7lzr"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiutIJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4rRAAjSy4+/OUKBuame7Ek7ZhaC5N1c2kW1Oba3Y1WV/fhRs31slo\r\nDH8omUMnB5oO5qvbeZtNVh+8QRbO8EkJliOzyVxUo0ngaHnEOqZHyKJ9D0S7\r\n50uiZD8MWAF11nWulRZmHBM0NgltwcRMKw0NYlh0tkaS1GnaE894AfmM0Uaq\r\nXParvZCbCW+vg7CVpvqQfAZnKjSFmxEYwAy2WSkYFnQXFCuZf6PdFQxilFLw\r\nyLhtIDcNH5gsPjHbsOx09DEM4xfY5H8vogO7Ci5DBsTNk5+50eZf7v3DSUem\r\n9FkFegCNDEj1l+CdcUK7LB3T8ivDnXHuCqzswUsj1EX6s9KEwjgVDQwoEZVO\r\n489lMaU1tFFGkVhAE6mOQiUCZtlJsSwfHL6aDcvPRtkw0BT4RVkIhIIZTrFR\r\nB2PYZMSwj2BhWVxPwqciTrwr2ts+1syfuIvdD3Asy+lwTEQNLLQqngXWy4bE\r\n4jzN9V5S52N3rWZtSAMfn3vvMeTBaI6ZaJbGz3n5v/VeReFZBZ9zOzhs1wvE\r\no8Pk8+2C0lKQ6thM5xOvNEXTM/nZLgO082dhSusI1TwjGnBJZI5el1FX4q9R\r\nsOJsNpF2iWWOhzY8xN63ZO1dtTlzEbzIfx67aG5zlKHXrVDvDBBCdjN2HeFy\r\nuHGzft2OXZ/daS85zW7ZhsUsIxFYHc+Lkr4=\r\n=FkgH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aaryankh","email":"aaryankhclasses07@gmail.com"},"directories":{},"maintainers":[{"name":"aaryankh","email":"aaryankhclasses07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dbapp_1.0.2_1656410633540_0.4142899505909945"},"_hasShrinkwrap":false},"1.0.2-p1":{"name":"@aaryankh/dbapp","version":"1.0.2-p1","decription":"A Local JSON-Based Database Application","main":"./dist/test/test.js","author":{"name":"AaryanKh"},"license":"MIT","scripts":{"start":"node ."},"dependencies":{"@types/node":"^18.0.0"},"repository":{"type":"git","url":"git+https://github.com/AaryanKhClasses/DatabaseApp.git"},"gitHead":"763b6bf1618e16adf20599a7d7278ebf7c8bd0a2","description":"---","bugs":{"url":"https://github.com/AaryanKhClasses/DatabaseApp/issues"},"homepage":"https://github.com/AaryanKhClasses/DatabaseApp#readme","_id":"@aaryankh/dbapp@1.0.2-p1","_nodeVersion":"18.0.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-mTndReYejNAHKO/rYVNa4noa0nez5X7POlzsAGjPginY6/iaCN5ZcsBuHzF/Ce3VFunLAIdZ4urcOefI7hs40w==","shasum":"2221ac0602181c182a313091122f0780b0695b7c","tarball":"https://registry.npmjs.org/@aaryankh/dbapp/-/dbapp-1.0.2-p1.tgz","fileCount":9,"unpackedSize":27030,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIANjq//kEwYpBqmkyJmr7gZiphOmC+a1lTv8sQc6wEkwAiEA+R4fzNrFKt0CEIV6GoQ/Sjscy75UrIMnp51pITMWekY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiutPWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv9xAAggWzCoEzQy0Af8nCzTEcuNsd/sCNLkOkq+wKCP5HFP+yimls\r\n3i6lMgcBHZ9RKryPNyGP+JNGtRQnXxxkkvRUn6u3IssOU+9iUN7PXxH/Iv7N\r\n24oWbv59NDsImL3btSpb0P7ywoQw8+L5RJvpPW3J3ZrgetsPf0FO7w5Ko/uk\r\nKREgG6OiUzZh4ou0G+jxoPYzVjs++TK0wJm/DF7BJaIxWqvvLBJa+kARCfxY\r\no8oDh8PgLiiyRnGRzuVZCdVwshlojKreI4m0V8opnPxNZjMbUG8fdGkB6Gmd\r\nWxUY/cSpOtZaYAh73sC5DoLpllrnibroHHanCU9DpdapOIhezSuWP201Aj/H\r\nRuXz6y8ID9Oy9otmZ3Q5kXESkAtbXsyqTPLKm+QPh6HZzO02Pxm2AI6cetQ0\r\n9jnMb/6HlbC7vee3bCfP64XL4BbgjU1jJez+2pwCa9CDwzByZ+t2wVQHSdbX\r\njxATXTmiAj9xTngFpd9DO0JnEpzXu+OdoGONyvry2vmNaPGVifLjB8dAdqLT\r\nGQGR9LLXAALVSXDdbaYxZZWJcfjUQXckaGfrN1wShDP1DBKzVcTkdvmnlgTL\r\nRpH1hz1fsyhwqG7S9m6CwbU8w4y+xI8Q3tQ6NUNftACGRUjTTXoTrDy7SjH1\r\ncVydHgy8I2Jbvmvfs+KLxf2hHvUjhKcwR2s=\r\n=W52E\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aaryankh","email":"aaryankhclasses07@gmail.com"},"directories":{},"maintainers":[{"name":"aaryankh","email":"aaryankhclasses07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dbapp_1.0.2-p1_1656411094613_0.36363502780876966"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-28T10:03:53.495Z","1.0.2":"2022-06-28T10:03:53.684Z","modified":"2022-06-28T10:11:34.888Z","1.0.2-p1":"2022-06-28T10:11:34.802Z"},"maintainers":[{"name":"aaryankh","email":"aaryankhclasses07@gmail.com"}],"description":"---","homepage":"https://github.com/AaryanKhClasses/DatabaseApp#readme","repository":{"type":"git","url":"git+https://github.com/AaryanKhClasses/DatabaseApp.git"},"author":{"name":"AaryanKh"},"bugs":{"url":"https://github.com/AaryanKhClasses/DatabaseApp/issues"},"license":"MIT","readme":"# DatabaseApp\r\n### A Simple, Local JSON-Based Database Application.\r\n\r\n---\r\n\r\n## Contents\r\n- ### [Installation](#installation-1)\r\n- ### [Getting Started](#getting-started-1)\r\n- ### [Creating a Collection](#creating-a-collection-1)\r\n- ### [Inserting Data into Collection](#inserting-data-into-collection-1)\r\n- ### [Finding Data in a Collection](#finding-data-in-a-collection-1)\r\n- ### [Fetching / Getting Data from a Collection](#fetching--getting-data-from-a-collection-1)\r\n- ### [Find & Insert Data in a Collection](#find--insert-data-in-a-collection-1)\r\n- ### [Find & Update Data in a Collection](#find--update-data-in-a-collection-1)\r\n- ### [Find & Delete Data in a Collection](#find--delete-data-in-a-collection-1)\r\n- ### [Deleting a Collection](#deleting-a-collection-1)\r\n- ### [Clearing Data in a Collection](#clearing-data-in-a-collection-1)\r\n- ### [Future Features Plans](#future-features-plans-1)\r\n- ### [Credits](#credits-1)\r\n\r\n---\r\n\r\n## Installation\r\n### To install the package and create a database, run:\r\n```sh\r\n$npm install @aaryankh/dbapp\r\n```\r\n### After installing, import the package into your project:\r\n```ts\r\nimport Database from '@aaryankh/dbapp'\r\n```\r\n\r\n---\r\n\r\n## Getting started\r\n### The package provides many useful functions to work with local JSON-based databases.\r\n### To get started, create a new instance of the database app:\r\n```ts\r\nimport Database from '@aaryankh/dbapp'\r\nimport path from 'path'\r\n\r\nconst db = new Database(path.join(__dirname, 'path-to-db-folder'))\r\n```\r\n### You would need to specify the path to the folder where the database will be stored. (NOTE: It must be a folder 'path')\r\n\r\n---\r\n\r\n## Creating a Collection\r\n### To create a new collection in the database, use the `createCollection` method:\r\n```ts\r\ndb.createCollection('users', {\r\n    name: 'string',\r\n    age: 'number'\r\n})\r\n```\r\n### You must specify the name of the collection and the schema of the collection.\r\n\r\n---\r\n\r\n## Inserting Data into Collection\r\n### To insert data into a collection, use the `insert` method:\r\n```ts\r\ndb.insert('users', { name: 'John', age: 30 })\r\n```\r\n### You must specify the name of the collection and the data to insert.\r\n\r\n---\r\n\r\n## Finding Data in a Collection\r\n### To find data in a collection, use the `find` method:\r\n```ts\r\ndb.find('users', { name: 'John' })\r\n```\r\n### You must specify the name of the collection and the query to find the data.\r\n### This would return `true` if found and `false` if not found.\r\n\r\n---\r\n\r\n## Fetching / Getting Data from a Collection\r\n### To get data from a collection, use the `get` method:\r\n```ts\r\ndb.get('users', { name: 'John' })\r\n```\r\n### You must specify the name of the collection and the query to get the data.\r\n### This would return the data `array` if found.\r\n\r\n---\r\n\r\n## Find & Insert Data in a Collection\r\n### To find and insert data in a collection, use the `findInsert` method:\r\n```ts\r\ndb.findInsert('users', { name: 'John' }, { name: 'Mike', age: 30 })\r\n```\r\n### You must specify the name of the collection, the query to find the data, and the data to insert.\r\n\r\n---\r\n\r\n## Find & Update Data in a Collection\r\n### To find and update data in a collection, use the `findUpdate` method:\r\n```ts\r\ndb.findUpdate('users', { name: 'John' }, { name: 'Mike', age: 30 })\r\n```\r\n### You must specify the name of the collection, the query to find the data, and the data to update.\r\n### You also have the option to `upsert` (only modify the specified fields) to update.\r\n```ts\r\ndb.findUpdate('users', { name: 'John' }, { age: 30 }, true)\r\n// This will only update the age field.\r\n```\r\n\r\n---\r\n\r\n## Find & Delete Data in a Collection\r\n### To find and delete data in a collection, use the `findDelete` method:\r\n```ts\r\ndb.findDelete('users', { name: 'John' })\r\n```\r\n### You must specify the name of the collection and the query to find the data.\r\n### Warning, this will delete all data that matches the query.\r\n\r\n---\r\n\r\n## Deleting a Collection\r\n### To delete a collection, use the `deleteCollection` method:\r\n```ts\r\ndb.deleteCollection('users')\r\n```\r\n### You must specify the name of the collection to delete.\r\n### Warning, this will delete the whole collection.\r\n\r\n---\r\n\r\n## Clearing Data in a Collection\r\n### To clear data in a collection, use the `clear` method:\r\n```ts\r\ndb.clear('users')\r\n```\r\n### You must specify the name of the collection to clear.\r\n### Warning, this will delete all data in the collection.\r\n\r\n---\r\n\r\n## Future Features Plans\r\n### 1. Counting Data in a Collection\r\n### 2. GUI for Database App\r\n### 3. More advanced queries\r\n### and much more...\r\n\r\n---\r\n\r\n## Credits\r\n### Project Owner: [AaryanKhClasses](https://github.com/AaryanKhClasses)\r\n### Also Check My other Project: [Sayout Clone](https://github.com/AaryanKhClasses/Sayout-Clone)\r\n\r\n---\r\n","readmeFilename":"README.md"}