{"_id":"@dada78641/dadautil","name":"@dada78641/dadautil","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@dada78641/dadautil","description":"Basic state management helper tool for making CLI utilities","version":"0.0.1","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./util":{"types":"./dist/util.d.ts","import":"./dist/util.js","require":"./dist/util.js"}},"scripts":{"build":"tsup","watch":"tsup --watch src","test":"vitest run","test:watch":"vitest watch","lint":"eslint ."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/msikma/dadautil.git"},"license":"MIT","devDependencies":{"@stylistic/eslint-plugin":"^2.9.0","@types/better-sqlite3":"^7.6.13","eslint":"^9.0.0","jiti":"^2.4.2","tsup":"^8.3.5","typescript-eslint":"^8.0.0","typescript":"^5.6.3","vitest":"^3.2.0"},"dependencies":{"@dada78641/env-paths":"^0.1.0","better-sqlite3":"^11.10.0"},"_id":"@dada78641/dadautil@0.0.1","gitHead":"99f84e69a1ca7f485ae082e3f47f8b8ee2f0484a","bugs":{"url":"https://github.com/msikma/dadautil/issues"},"homepage":"https://github.com/msikma/dadautil#readme","_nodeVersion":"23.9.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-5b7XSSuJyTO+zKLqB0NjIM12skiL2MW7WgS0JfpnQYctxeXoyrHvtrJfs5o/9jXP1z4Eb4vR9Pxx3rtE0rx/Dw==","shasum":"4b6cf92a2ed9d0e1bc5f976eaa5260a0de13d247","tarball":"https://registry.npmjs.org/@dada78641/dadautil/-/dadautil-0.0.1.tgz","fileCount":5,"unpackedSize":10937,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDebJYcBljR+nj62wlujPjmv0tx63+PZWK3E+k0jfQ+mAIgKVs9AEXFrvM2l1+7oHOVIX8Ut5Huq/Gn3WxWun4rMdU="}]},"_npmUser":{"name":"dada78641","email":"dada78641.exe@gmail.com"},"directories":{},"maintainers":[{"name":"dada78641","email":"dada78641.exe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dadautil_0.0.1_1748966285252_0.08522570375597716"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-03T15:58:05.142Z","0.0.1":"2025-06-03T15:58:05.425Z","modified":"2025-06-03T15:58:05.700Z"},"maintainers":[{"name":"dada78641","email":"dada78641.exe@gmail.com"}],"description":"Basic state management helper tool for making CLI utilities","homepage":"https://github.com/msikma/dadautil#readme","repository":{"type":"git","url":"git+https://github.com/msikma/dadautil.git"},"bugs":{"url":"https://github.com/msikma/dadautil/issues"},"license":"MIT","readme":"[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=fff)](https://www.typescriptlang.org/) [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/@dada78641%2Fdadautil.svg)](https://badge.fury.io/js/@dada78641%2Fdadautil)\n\n# @dada78641/DadaUtil\n\nBasic configuration and cache utility for CLI tool development.\n\nThis package offers a straightforward API for managing configuration files at `~/.config/APPNAME/config.json` and cache databases at `~/.cache/APPNAME/db.sqlite3`. It simplifies persistent data storage and retrieval.\n\nIdeal for simple CLI tools that require basic persistent state, without the overhead of a complex database.\n\n## Usage\n\n```ts\nimport {DadaUtil} from './src/index.ts'\n\ntype UtilConfig = {\n  hello: string;\n  world: number;\n}\n\nconst util = new DadaUtil<UtilConfig>('dadautiltest');\nawait util.init(); // opens the db and ensures the directories exist\n\nconst hello = util.getConfig('hello'); // string | null\nconst world = util.getConfig('world'); // number | null\nconsole.log([hello, world]); // [null, null] unless your config.json file has them set\nutil.set('someCacheKey', {hello: 'world'});\nconst value = util.get<{hello: string}>('someCacheKey');\nconsole.log(value); // {hello: 'world'}\n```\n\n## License\n\nMIT licensed.\n","readmeFilename":"readme.md","_rev":"1-d31869c38340b3fcad686473a7dc891e"}