{"_rev":"26-143e1b3bb228e9394404f683c16ee7f8","time":{"created":"2025-01-19T16:45:33.505Z","modified":"2025-01-19T16:45:34.014Z","1.0.0":"2024-10-27T16:27:56.276Z","1.5.0":"2024-10-27T16:29:32.839Z","1.5.1":"2024-10-27T16:30:06.525Z","1.5.2":"2024-10-27T16:48:04.460Z","1.5.3":"2024-10-29T06:52:35.335Z","1.5.4":"2024-10-29T06:54:11.088Z","1.5.5":"2024-10-29T06:56:21.312Z","1.5.6":"2024-10-29T06:56:49.897Z","1.5.7":"2024-10-29T07:01:35.622Z","1.5.8":"2024-10-29T07:05:04.015Z","1.5.9":"2024-10-29T07:08:26.559Z","1.6.0":"2024-10-29T07:10:18.607Z","1.6.1":"2024-10-29T07:11:39.447Z","2.5.0":"2024-10-29T09:29:39.317Z","2.5.1":"2024-10-29T09:57:34.540Z","2.5.2":"2024-10-29T10:01:41.666Z","2.5.3":"2024-10-30T20:51:31.565Z","2.5.4":"2024-10-30T20:55:31.326Z","2.5.5":"2024-10-31T19:57:05.633Z","2.5.6":"2024-10-31T19:57:21.204Z","2.5.7":"2024-12-01T18:34:48.684Z","2.5.8":"2024-12-05T19:46:55.030Z","2.5.9":"2024-12-07T20:07:57.067Z","2.6.0":"2024-12-09T15:32:14.756Z","2.6.1":"2024-12-09T19:35:28.554Z","2.6.2":"2025-01-19T16:45:33.705Z"},"_id":"oxzof-db","name":"oxzof-db","dist-tags":{"latest":"2.6.2"},"versions":{"2.6.2":{"name":"oxzof-db","version":"2.6.2","description":"- It is a simple data processing module based on BSON.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["oxzof","oxzofdb","database","oxzof-db","veritabanı","bsondb","bson-db"],"author":"","license":"MIT","dependencies":{"bson":"^6.9.0","cli-table3":"^0.6.5","fs":"^0.0.1-security","path":"^0.12.7"},"_id":"oxzof-db@2.6.2","gitHead":"087199744bcbd38d869deabd7f73bde8701689ba","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-XkRwIJAoNpOzYAkNdzTlvNbVgyDYdQTViAcf8AdnPm8ipuqbUsfBGL67ekeI0ZI8FnGkLQLhYLFYJYHZid6YQw==","shasum":"ab37f1fd610acb0e69cc23cd11bb7129756b119d","tarball":"https://registry.npmjs.org/oxzof-db/-/oxzof-db-2.6.2.tgz","fileCount":5,"unpackedSize":17923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPGvs/C+/ufgBl5LiYWKnwStwnAZR88cBzqzN+B8ktMAiAoeLwNNYQ7ibKvRH9Y83fSpFMt5X4V2kR5KZhcbHMh4Q=="}]},"_npmUser":{"name":"westra12","email":"yasin@oxzof.com"},"directories":{},"maintainers":[{"name":"westra12","email":"yasin@oxzof.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oxzof-db_2.6.2_1737305133506_0.9039781060971253"},"_hasShrinkwrap":false}},"maintainers":[{"name":"westra12","email":"yasin@oxzof.com"}],"description":"- It is a simple data processing module based on BSON.","keywords":["oxzof","oxzofdb","database","oxzof-db","veritabanı","bsondb","bson-db"],"license":"MIT","readme":"# OXZOF DB\r\n- It is a simple data processing module based on BSON.\r\n\r\n## Functions\r\n-  set(key, value)\r\nCreates a new variable or modifies an existing variable.\r\n\r\n- get(key)\r\nReturns the dataset matching the variable key.\r\n\r\n- push(key,value)\r\nAdds a new value to the dataset whose value is list.\r\n\r\n- unpush(key,value)\r\nDeletes element(s) from the array.\r\n\r\n- unpushByIndex(key,index)\r\nRemoves the index element from the list\r\n\r\n- delete(key)\r\nDeletes the matching dataset from the database.\r\n\r\n- deleteAll()\r\nClears entire database\r\n\r\n- all()\r\nReturns all data in the database.\r\n\r\n## Examples\r\n```javascript\r\nconst database = require('oxzof-db');\r\n\r\n// const db = database(\" FILE PATH \",{ OPTIONS });\r\nconst db = database(); // default path\r\n/* \r\nconst db = database(\"./oxzof-db/db.bson\",{\r\n    logMessages:true, // writes function errors to the console.\r\n    autoUpdate:true // if update available: will be updated automatically when the project is restarted.\r\n});\r\n*/\r\n\r\nawait db.set('potato','hello'); // Assign the value \"hello\" to the key \"potato\".\r\nawait db.get('potato'); // returns \"hello\"\r\n\r\nawait db.push('array','new element'); // Adds a new value named \"new element\" to the \"array\" list.\r\n//  await db.push('array',['new element','another data']); // Push list to list\r\nawait db.unpush('array','new element'); // Deletes element from the array.\r\n//  await db.unpush('array',['new element','another data']); // Remove specific elements from the list.\r\nawait db.unpushByIndex(\"array\",0) // Removes element 0 from the list \"array\".\r\n\r\nawait db.all(); // Returns all data in the database.\r\n\r\nawait db.delete('key'); // Remove the object matching the \"key\" object in the data.\r\nawait db.deleteAll(); // clears entire database\r\n```\r\n\r\n# Example Usages\r\n\r\n## Import Module\r\n\r\n```javascript\r\nconst database = require('oxzof-db');\r\nconst db = database(null,{ // default file path\r\n    logMessages:true, // writes function errors to the console.\r\n    autoUpdate:true // if update available: will be updated automatically when the project is restarted.\r\n});\r\n```\r\n\r\n\r\n## Set & Get Functions\r\n```javascript\r\n(async()=>{\r\n    const d = await db.set(\"dog\",\"dogs flying\")\r\n    console.log(d) // returns: dogs flying\r\n                   // returns false if there is an error\r\n})()\r\n```\r\n\r\n```javascript\r\n(async()=>{\r\n    const d = await db.get(\"dog\")\r\n    console.log(d) // returns: dogs flying\r\n\r\n    const a = await db.get(\"dogs\")\r\n    console.log(a) // returns: null\r\n})()\r\n```\r\n\r\n## Push Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.push(\"items\",[\"money\", \"flashlight\", \"phone\", \"bag\"])\r\n    console.log(d) // returns: [ 'money', 'flashlight', 'phone', 'bag' ]\r\n})()\r\n```\r\n\r\n## Unpush Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.unpush(\"items\",[\"money\",\"phone\"])\r\n    console.log(d) // returns: [ 'flashlight', 'bag' ]\r\n})()\r\n```\r\n\r\n## UnpushByIndex Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.unpushByIndex(\"items\",0)\r\n    console.log(d) // returns: [ 'bag' ]\r\n})()\r\n```\r\n\r\n## All Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.all()\r\n    console.log(d) // returns: [ { items: [ 'bag' ] }, { dog: 'dogs flying' } ]\r\n})()\r\n```\r\n\r\n## Delete Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.delete(\"items\")\r\n    console.log(d) // returns: true (Returns false if there is no key)\r\n})()\r\n```\r\n\r\n## DeleteAll Function\r\n```javascript\r\n(async()=>{\r\n    const d = await db.deleteAll()\r\n    console.log(d) // returns: true\r\n})()\r\n```","readmeFilename":"README.md"}