{"_id":"@getdashfy/utils","_rev":"2-4c164fa85e034dc40844542e0cf0c188","name":"@getdashfy/utils","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@getdashfy/utils","version":"0.1.0","keywords":["dashfy","utils","format","bytes","currency","date","exponential","list","number","ordinal","percent","temperature","time","error","function","object","platform","string"],"author":{"url":"https://github.com/brenopolanski","name":"Breno Polanski","email":"breno@dashfy.dev"},"license":"AGPL-3.0-or-later","_id":"@getdashfy/utils@0.1.0","maintainers":[{"name":"breno.polanski","email":"breno.polanski@gmail.com"}],"homepage":"https://github.com/dashfy/dashfy#readme","bugs":{"url":"https://github.com/dashfy/dashfy/issues"},"dist":{"shasum":"aa82a47f6c1f312198370a79409427007078d900","tarball":"https://registry.npmjs.org/@getdashfy/utils/-/utils-0.1.0.tgz","fileCount":10,"integrity":"sha512-nfMXlswXBWpqEyfGjlgFJ8wGtNd0UL7CgIkd4JadKLyoEEVVN8CKghuTVT7TAPxB94h6BW9kHU5/DwS7jU6qvA==","signatures":[{"sig":"MEYCIQDVm+Zwc2ik9DmhwxGMcWIe4QpQP1j+8yYj/dMDApFFuwIhAJYfxuUfEurGMQCjeZXT2b0dAq4bKOnmIK6EnVX2lgVS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206242},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a9c3cc2390f7acde400f313f6d38703e1790bd72","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rm -rf .turbo dist node_modules","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","check:circular":"madge --circular --extensions ts src/"},"_npmUser":{"name":"breno.polanski","email":"breno.polanski@gmail.com"},"repository":{"url":"git+ssh://git@github.com/dashfy/dashfy.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.13.0","description":"Formatting and utility functions for Dashfy - numbers, currencies, bytes, dates, times, strings, platform detection, and more","directories":{},"_nodeVersion":"25.0.0","dependencies":{"date-fns":"^4.1.0","pretty-bytes":"^7.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.2","@types/node":"^25.0.0","@getdashfy/tsconfig":"workspace:*","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.1.0_1784641497651_0.11619685210236042","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@getdashfy/utils","version":"0.1.1","description":"Formatting and utility functions for Dashfy - numbers, currencies, bytes, dates, times, strings, platform detection, and more","keywords":["dashfy","utils","format","bytes","currency","date","exponential","list","number","ordinal","percent","temperature","time","error","function","object","platform","string"],"homepage":"https://github.com/dashfy/dashfy#readme","bugs":{"url":"https://github.com/dashfy/dashfy/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/dashfy/dashfy.git","directory":"packages/utils"},"license":"AGPL-3.0-or-later","author":{"name":"Breno Polanski","email":"breno@dashfy.dev","url":"https://github.com/brenopolanski"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"engines":{"node":">=20.0.0"},"dependencies":{"date-fns":"^4.1.0","pretty-bytes":"^7.1.0"},"devDependencies":{"@types/node":"^25.0.0","@vitest/coverage-v8":"^2.1.9","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^2.1.8","@getdashfy/tsconfig":"0.0.0"},"scripts":{"build":"tsup","check:circular":"madge --circular --extensions ts src/","clean":"rm -rf .turbo dist node_modules","dev":"tsup --watch","test":"vitest run","test:coverage":"vitest run --coverage","test:watch":"vitest","typecheck":"tsc --noEmit"},"_id":"@getdashfy/utils@0.1.1","_integrity":"sha512-GksCmUpS8kypatNTEYxfTrcodZIdKXmQMO8pRwGqf4Q108zX6STTfqH6kjtczgw1b/6ZicsmUCIBM0Tf6SbVeA==","_resolved":"/private/var/folders/40/yqjd7mn110s9hm89bcd98dfc0000gn/T/2384c3f5f737ea8aebb1f51acf6f6945/getdashfy-utils-0.1.1.tgz","_from":"file:getdashfy-utils-0.1.1.tgz","_nodeVersion":"25.0.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-GksCmUpS8kypatNTEYxfTrcodZIdKXmQMO8pRwGqf4Q108zX6STTfqH6kjtczgw1b/6ZicsmUCIBM0Tf6SbVeA==","shasum":"66d589fbc075098eca9e7ce6750bd6dfd54ab35c","tarball":"https://registry.npmjs.org/@getdashfy/utils/-/utils-0.1.1.tgz","fileCount":10,"unpackedSize":206336,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDrX1D2OAPl/Y3Ljgli/eWNFjQ1Nphw0bT4xbjfNPE/kAiAldj0BH9rFWlhFzj/LT8NyzK88l8yh+eTilNTgEtqhXg=="}]},"_npmUser":{"name":"breno.polanski","email":"breno.polanski@gmail.com"},"directories":{},"maintainers":[{"name":"breno.polanski","email":"breno.polanski@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utils_0.1.1_1784685609244_0.002128309355410085"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-21T13:44:57.358Z","modified":"2026-07-22T02:00:09.853Z","0.1.0":"2026-07-21T13:44:57.785Z","0.1.1":"2026-07-22T02:00:09.412Z"},"bugs":{"url":"https://github.com/dashfy/dashfy/issues"},"author":{"name":"Breno Polanski","email":"breno@dashfy.dev","url":"https://github.com/brenopolanski"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/dashfy/dashfy#readme","keywords":["dashfy","utils","format","bytes","currency","date","exponential","list","number","ordinal","percent","temperature","time","error","function","object","platform","string"],"repository":{"type":"git","url":"git+ssh://git@github.com/dashfy/dashfy.git","directory":"packages/utils"},"description":"Formatting and utility functions for Dashfy - numbers, currencies, bytes, dates, times, strings, platform detection, and more","maintainers":[{"name":"breno.polanski","email":"breno.polanski@gmail.com"}],"readme":"# `@getdashfy/utils`\n\n> Formatting and utility functions for Dashfy - numbers, currencies, bytes, dates, times, strings, platform detection, and more.\n\n## Introduction\n\n`@getdashfy/utils` provides formatting and utility functions for Dashfy dashboards. It includes:\n\n- **Format** - A flexible format API inspired by [Numeral.js](https://numeraljs.com) for numbers, dates, times, bytes, and more\n- **Error** - Safe error message extraction\n- **Function** - Utilities for common patterns\n- **Object** - Safe nested property access\n- **Platform** - Environment detection and OS helpers\n- **String** - String manipulation and display helpers\n- **Libs** - Re-export of [date-fns](https://date-fns.org)\n\n## Install\n\nInstall with your favorite package manager:\n\n#### `npm`\n\n```bash\nnpm install @getdashfy/utils\n```\n\n#### `pnpm`\n\n```bash\npnpm add @getdashfy/utils\n```\n\n#### `yarn`\n\n```bash\nyarn add @getdashfy/utils\n```\n\n#### `bun`\n\n```bash\nbun add @getdashfy/utils\n```\n\n## Quick Start\n\n```ts\nimport { format, debounce, get, truncate, isClient } from '@getdashfy/utils'\n\n// Format numbers with thousands separators\nformat(1000, '0,0')\n// '1,000'\n\n// Format compact notation\nformat(1500000, '0.0a')\n// '1.5M'\n\n// Format relative dates\nformat(new Date(), 'relative')\n// 'less than a minute ago'\n\n// Safely access nested object properties\nget({ user: { name: 'John' } }, 'user.name')\n// 'John'\n\n// Truncate a long string\ntruncate('This is a long title that needs trimming', 20)\n// 'This is a long title...'\n\n// Debounce a function call\nconst debouncedSearch = debounce((query: string) => fetchResults(query), 300)\n\n// Check execution environment\nisClient // true in browser\n```\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Build\npnpm build\n\n# Watch mode\npnpm dev\n\n# Run tests\npnpm test\n\n# Run tests with coverage\npnpm test:coverage\n\n# Type check\npnpm typecheck\n```\n\n## Community\n\nJoin the community on [Dashfy's Discord server](https://dashfy.dev/discord) to discuss the project, ask questions, or get help.\n\nJoin the conversation on X (Twitter) and follow [@dashfydev](https://x.com/dashfydev) for updates and announcements.\n\n## License\n\nThis project is licensed under the AGPL-3.0 License - see the [LICENSE](./LICENSE) file for details.\n","readmeFilename":"README.md"}