{"_id":"@asteby/metacore-lib","_rev":"4-9ab6d1c8ebd673b09c17ec31595b78a7","name":"@asteby/metacore-lib","dist-tags":{"latest":"0.6.0"},"versions":{"0.3.0":{"name":"@asteby/metacore-lib","version":"0.3.0","license":"Apache-2.0","_id":"@asteby/metacore-lib@0.3.0","maintainers":[{"name":"asteby-hq","email":"dannyjp49@gmail.com"}],"homepage":"https://github.com/asteby/metacore-sdk#readme","bugs":{"url":"https://github.com/asteby/metacore-sdk/issues"},"dist":{"shasum":"0e7f73126688c0f4d3ecfb842be551049213d7c8","tarball":"https://registry.npmjs.org/@asteby/metacore-lib/-/metacore-lib-0.3.0.tgz","fileCount":23,"integrity":"sha512-mymiT3VPkU+mAWHdcoWplBTLLf34Ht5jgZKWTCDLJRlDZURGSZoAP6zwHi+MRFEEEVbglpEWkAwBpC53awBhfQ==","signatures":[{"sig":"MEUCIHRVqxhylbShfBBM7/xXYVZKx3R5A1bTtd3dJhkFADvAAiEA+RQiY4pG/150ixGtkF6vt7RzE+oBUbL2v6puEc5Ok1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43410},"main":"./dist/index.js","type":"module","_from":"file:asteby-metacore-lib-0.3.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./date":{"types":"./dist/date.d.ts","import":"./dist/date.js"},"./errors":{"types":"./dist/errors.d.ts","import":"./dist/errors.js"},"./format":{"types":"./dist/format.d.ts","import":"./dist/format.js"},"./currency":{"types":"./dist/currency.d.ts","import":"./dist/currency.js"}},"scripts":{"dev":"tsc -w -p tsconfig.json","build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"asteby-hq","email":"dannyjp49@gmail.com"},"_resolved":"/tmp/9a2203ebf407ba761870edacd5ee005e/asteby-metacore-lib-0.3.0.tgz","_integrity":"sha512-mymiT3VPkU+mAWHdcoWplBTLLf34Ht5jgZKWTCDLJRlDZURGSZoAP6zwHi+MRFEEEVbglpEWkAwBpC53awBhfQ==","repository":{"url":"git+https://github.com/asteby/metacore-sdk.git","type":"git","directory":"packages/lib"},"_npmVersion":"10.8.2","description":"Metacore utilities — date/currency/number formatting, error handling, cookies","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"sonner":"^1.7.0","date-fns":"^4.1.0","typescript":"^5.6.0"},"peerDependencies":{"sonner":">=1.7","date-fns":">=3"},"peerDependenciesMeta":{"sonner":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metacore-lib_0.3.0_1776716710984_0.44577099544504795","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@asteby/metacore-lib","version":"0.4.0","license":"Apache-2.0","_id":"@asteby/metacore-lib@0.4.0","maintainers":[{"name":"asteby-hq","email":"dannyjp49@gmail.com"}],"homepage":"https://github.com/asteby/metacore-sdk#readme","bugs":{"url":"https://github.com/asteby/metacore-sdk/issues"},"dist":{"shasum":"e257ed09d26ff434ff87d7599bda6b2c85226e6a","tarball":"https://registry.npmjs.org/@asteby/metacore-lib/-/metacore-lib-0.4.0.tgz","fileCount":27,"integrity":"sha512-SlDjPNNZeOT6ShuB+75AgGQS2gmJIs+ss4q0fmB5l9mOJ3LHwTtNJIuxueyXpH9EjrWCgIVpe/+xybydAzeZZA==","signatures":[{"sig":"MEUCIQCR5OyIqjW84fmT02cDiVsjeCRk3QyQdprVF2ZaNY2SkwIgWQvoT/xDSre4ei6fugXciZZ1KPU3p9jotjZOiI9TEtA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45820},"main":"./dist/index.js","type":"module","_from":"file:asteby-metacore-lib-0.4.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./date":{"types":"./dist/date.d.ts","import":"./dist/date.js"},"./errors":{"types":"./dist/errors.d.ts","import":"./dist/errors.js"},"./format":{"types":"./dist/format.d.ts","import":"./dist/format.js"},"./currency":{"types":"./dist/currency.d.ts","import":"./dist/currency.js"},"./show-submitted-data":{"types":"./dist/show-submitted-data.d.ts","import":"./dist/show-submitted-data.js"}},"scripts":{"dev":"tsc -w -p tsconfig.json","build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"asteby-hq","email":"dannyjp49@gmail.com"},"_resolved":"/tmp/67cac0b2857c79f943eec02451ac6a6c/asteby-metacore-lib-0.4.0.tgz","_integrity":"sha512-SlDjPNNZeOT6ShuB+75AgGQS2gmJIs+ss4q0fmB5l9mOJ3LHwTtNJIuxueyXpH9EjrWCgIVpe/+xybydAzeZZA==","repository":{"url":"git+https://github.com/asteby/metacore-sdk.git","type":"git","directory":"packages/lib"},"_npmVersion":"10.8.2","description":"Metacore utilities — date/currency/number formatting, error handling, cookies","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.4","sonner":"^2.0.0","date-fns":"^4.1.0","typescript":"^5.6.0","@types/react":"^19.2.14"},"peerDependencies":{"react":">=18","sonner":">=1.7","date-fns":">=3"},"peerDependenciesMeta":{"react":{"optional":true},"sonner":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metacore-lib_0.4.0_1777516275367_0.4275412021131968","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@asteby/metacore-lib","version":"0.5.0","license":"Apache-2.0","_id":"@asteby/metacore-lib@0.5.0","maintainers":[{"name":"asteby-hq","email":"dannyjp49@gmail.com"}],"dist":{"shasum":"1adc77ebb7b80ecd30647dcc7faf0aa82bc09ec0","tarball":"https://registry.npmjs.org/@asteby/metacore-lib/-/metacore-lib-0.5.0.tgz","fileCount":27,"integrity":"sha512-NGVqykzCJfNsV6EGNO6fpXxjkeDqhH+DRZUa61YMz6rbkia9bW4H4ztHHn1foOWDo5XN7DQB5tY9nMT6udMAbg==","signatures":[{"sig":"MEMCH0bwBr2I1E8xR7AmhstvZxPn8CjTyutkmovN/+nq5D4CIDtVaisrcJPnU17fKSy+NhuHn1WiXOpFof9odlKprVym","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHWC42VbAEiYkQsdrVpBVcd2l4MzTMkaUvNsjk0ZTQQQAiBu+Nn8EuBYuoRwS4DBEsHt+FYHFm2HVW9QUNJWeh3n6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46685},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./date":{"types":"./dist/date.d.ts","import":"./dist/date.js"},"./errors":{"types":"./dist/errors.d.ts","import":"./dist/errors.js"},"./format":{"types":"./dist/format.d.ts","import":"./dist/format.js"},"./currency":{"types":"./dist/currency.d.ts","import":"./dist/currency.js"},"./show-submitted-data":{"types":"./dist/show-submitted-data.d.ts","import":"./dist/show-submitted-data.js"}},"scripts":{"dev":"tsc -w -p tsconfig.json","build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"asteby-hq","email":"dannyjp49@gmail.com"},"repository":{"url":"https://github.com/asteby/metacore-sdk","type":"git","directory":"packages/lib"},"description":"Metacore utilities — date/currency/number formatting, error handling, cookies","directories":{},"_nodeVersion":"22.23.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.4","sonner":"^2.0.0","date-fns":"^4.1.0","typescript":"^6.0.0","@types/react":"^19.2.14"},"peerDependencies":{"react":">=18","sonner":">=1.7","date-fns":">=3"},"peerDependenciesMeta":{"react":{"optional":true},"sonner":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metacore-lib_0.5.0_1790010308479_0.31532614079833543","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"_id":"@asteby/metacore-lib@0.6.0","dist":{"shasum":"94ea0a8606af106dc8576581f907e129f3a16c9d","tarball":"https://registry.npmjs.org/@asteby/metacore-lib/-/metacore-lib-0.6.0.tgz","fileCount":31,"integrity":"sha512-j6V2M2OmvV5zbX2OIea3BS8QaIkIBowDak6Jq7Q0QsxO22o2wSW2z42P9G55OscA/qtIKnQGuFkqxm7uhvC+ow==","signatures":[{"sig":"MEUCIQC7sQonjD1tmK906gB8lgIn+WzDO6gTxvaw2V2u6GCsvQIgBORz4LOYPcSubFenb1tYT782uPedBctMnly88t/10V0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDoobBla832bV/MCfk8n5z0E6miVTsv1aOa9SZR2No6lgIgcCbECyCjC0upj9mxBBko3lLSaooE7OqhPe4xLJ7K2Tg="}],"unpackedSize":65481},"main":"./dist/index.js","name":"@asteby/metacore-lib","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./date":{"types":"./dist/date.d.ts","import":"./dist/date.js"},"./errors":{"types":"./dist/errors.d.ts","import":"./dist/errors.js"},"./format":{"types":"./dist/format.d.ts","import":"./dist/format.js"},"./currency":{"types":"./dist/currency.d.ts","import":"./dist/currency.js"},"./http-errors":{"types":"./dist/http-errors.d.ts","import":"./dist/http-errors.js"},"./show-submitted-data":{"types":"./dist/show-submitted-data.d.ts","import":"./dist/show-submitted-data.js"}},"license":"Apache-2.0","scripts":{"dev":"tsc -w -p tsconfig.json","test":"vitest run","build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.6.0","_npmUser":{"name":"asteby-hq","email":"dannyjp49@gmail.com"},"repository":{"url":"https://github.com/asteby/metacore-sdk","type":"git","directory":"packages/lib"},"description":"Metacore utilities — date/currency/number formatting, error handling, cookies","directories":{},"maintainers":[{"name":"asteby-hq","email":"dannyjp49@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.4","sonner":"^2.0.0","vitest":"^4.0.0","date-fns":"^4.1.0","typescript":"^6.0.0","@types/react":"^19.2.14"},"peerDependencies":{"react":">=18","sonner":">=1.7","date-fns":">=3"},"peerDependenciesMeta":{"react":{"optional":true},"sonner":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/metacore-lib_0.6.0_1790653988810_0.6466797685645476"}}},"time":{"created":"2026-04-20T20:25:10.877Z","modified":"2026-09-29T03:53:09.089Z","0.3.0":"2026-04-20T20:25:11.129Z","0.4.0":"2026-04-30T02:31:15.522Z","0.5.0":"2026-09-21T17:05:08.580Z","0.6.0":"2026-09-29T03:53:08.899Z"},"license":"Apache-2.0","repository":{"url":"https://github.com/asteby/metacore-sdk","type":"git","directory":"packages/lib"},"description":"Metacore utilities — date/currency/number formatting, error handling, cookies","maintainers":[{"name":"asteby-hq","email":"dannyjp49@gmail.com"}],"readme":"# @asteby/metacore-lib\n\nPure utilities shared across the Metacore ecosystem. No React, no DOM.\n\nCovers:\n\n- **date** — `formatDate`, `formatDistance`, `formatRelative`, `getAllTimezones`\n- **format** — `formatNumber`, `formatPercentage`, `truncate`\n- **currency** — `formatCurrency`, `parseCurrency`, `getCurrencySymbol`, `SPANISH_SYMBOLS`\n- **errors** — `handleServerError(error, toast?, { labels?, logger? })`\n\nCookie helpers live in `@asteby/metacore-ui/lib` (`getCookie`, `setCookie`, `removeCookie`).\n\n## Install\n\n```bash\npnpm add @asteby/metacore-lib date-fns\n# sonner is an optional peer for the error handler\npnpm add sonner\n```\n\n## Usage\n\n```ts\nimport { formatCurrency, parseCurrency } from '@asteby/metacore-lib/currency'\nimport { formatDate, formatDistance } from '@asteby/metacore-lib/date'\nimport { formatNumber, truncate } from '@asteby/metacore-lib/format'\nimport { handleServerError } from '@asteby/metacore-lib/errors'\nimport { toast } from 'sonner'\n\nformatCurrency(1234.56, 'USD', 'en') // \"$1,234.56\"\nparseCurrency('S/ 1.234,56') // 1234.56\nformatDate('2024-01-15', 'dd/MM/yyyy') // \"15/01/2024\"\nformatDistance('2024-01-01') // \"about 2 years ago\"\nformatNumber(1234.5, { locale: 'es' }) // \"1.234,5\"\ntruncate('hello world', 5) // \"hello…\"\n\ntry {\n  // ...\n} catch (err) {\n  handleServerError(err, toast, {\n    labels: {\n      unauthorized: 'Sesión expirada',\n      forbidden: 'No tienes permisos',\n      notFound: 'Recurso no encontrado',\n    },\n  })\n}\n```\n\n## Error labels\n\n`handleServerError` accepts an injected `toast` so consumers decide the UI binding, and an optional `labels` map for localization.\n\n```ts\ninterface ErrorLabels {\n  generic: string\n  notFound: string\n  unauthorized: string\n  forbidden: string\n  network: string\n  timeout: string\n}\n```\n\n## License\n\nApache-2.0\n","readmeFilename":""}