{"id":19837127,"url":"https://github.com/smaug6739/sidonie","last_synced_at":"2026-05-03T09:39:03.936Z","repository":{"id":104407942,"uuid":"378074613","full_name":"Smaug6739/Sidonie","owner":"Smaug6739","description":"📦 Sidonie is a prototype of module to manipulate json data.","archived":false,"fork":false,"pushed_at":"2022-06-27T19:07:00.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T22:12:04.989Z","etag":null,"topics":["data","database","javascript","json","module","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Smaug6739.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-18T07:48:49.000Z","updated_at":"2022-09-05T17:40:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e44b883-c1ba-41fc-9eaa-2294c55cb2d5","html_url":"https://github.com/Smaug6739/Sidonie","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Smaug6739/Sidonie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smaug6739%2FSidonie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smaug6739%2FSidonie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smaug6739%2FSidonie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smaug6739%2FSidonie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Smaug6739","download_url":"https://codeload.github.com/Smaug6739/Sidonie/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smaug6739%2FSidonie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271166757,"owners_count":24710562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","database","javascript","json","module","typescript"],"created_at":"2024-11-12T12:13:38.234Z","updated_at":"2026-05-03T09:39:03.896Z","avatar_url":"https://github.com/Smaug6739.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sidonie\n\nSidonie is a prototype of module for manipulate json data.\n\n\u003e **Warning**  \n\u003e You shouldn't use it in production with large amount of data\n\n## Getting started\n\nThis instructions will help you to get started with Sidonie.\n\n### Prerequisites\n\n- Node.js version 16.0.0 or higher [nodejs.org](https://nodejs.org/en/download/)\n- TypeScript version 4.5.0 or higher [typescriptlang.org](https://www.typescriptlang.org/) (optional, only if you want to compile yourself the code)\n\n### Installation\n\n#### Using npm\n\n```bash\nnpm install @smaug6739/sidonie\n```\n\n#### Using yarn\n\n```bash\nyarn add @smaug6739/sidonie\n```\n\n### Importation\n\n#### CommonJS syntax\n\n```js\nconst { Sidonie } = require(\"@smaug6739/sidonie\");\n```\n\n#### Ecama script modules syntax\n\n```js\nimport { Sidonie } from \"@smaug6739/sidonie\";\n```\n\n## Usage\n\n### Create a new instance\n\nTo use Sidonie, you need to create a new instance of client.\n\n#### Parameters\n\n- `path`: path to the json file. Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n```js\nconst database = new Sidonie(\"/path/to/database.json\");\n```\n\n- **Properties**\n\n  - [path](#path)\n\n- **Methods**\n\n  - [fetch()](#async-fetch)\n  - [getAll()](#async-getall)\n  - [get()](#async-get)\n  - [setData()](#async-setdata)\n  - [saveData()](#async-savedata)\n\n- **Events**\n\n  - [warn](#warn)\n  - [error](#error)\n\n## Properties\n\n### path\n\nReturn the path of the json file.\n\nType: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n## Methods\n\n### [async] fetch()\n\nThis method will fetch the json file and return the data.\n\nType: Any\n\n```js\nconst data = await database.fetch();\n```\n\n### [async] getAll()\n\n- **Parameters**\n  - `fetch`: If the function need to fetch file when cache is outdated. Type: [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)\n\nThis method will return all the data in cache.\n\nType: Any\n\n```js\nconst data = await database.getAll(true);\n```\n\n### [async] get()\n\n- **Parameters**\n  - `item`: The item to get in file. Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)\n  - `fetch`: If the function need to fetch file when cache is outdated. Type: [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)\n\nThis method will return the data in cache.\n\nType: Any\n\n```js\nconst data = await database.get(\"users\", true);\n```\n\n### [async] setData()\n\n- **Parameters**\n  - `data`: The data to save. Type: Any\n\nThis method will set data and write it to the file.\n\nType: Any\n\n```js\nconst data = await database.setData(\n  {\n    users: [\n      { name: \"John\", age: 30 },\n      { name: \"Jane\", age: 20 },\n      { name: \"Jack\", age: 25 },\n    ],\n  },\n  true\n);\n```\n\n### [async] saveData()\n\n- **Parameters**\n  - `data`: The data to save. Type: Any\n\nThis method will save data and write it to the file without overide data.\n\nType: Any\n\n```js\nconst data = await database.saveData(\n  {\n    users: [\n      { name: \"John\", age: 30 },\n      { name: \"Jane\", age: 20 },\n      { name: \"Jack\", age: 25 },\n    ],\n  },\n  true\n);\n```\n\n## Events\n\n### warn\n\nThis event will be triggered when a warning is thrown.\n\n- **Parameters**\n  - `message`: The message of the warning. Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n```js\ndatabase.on(\"warn\", (message) =\u003e {\n  console.log(message);\n});\n```\n\n### error\n\nThis event will be triggered when an error is thrown.\n\n- **Parameters**\n  - `message`: The message of the error. Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n```js\ndatabase.on(\"error\", (message) =\u003e {\n  console.log(message);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaug6739%2Fsidonie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmaug6739%2Fsidonie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmaug6739%2Fsidonie/lists"}