{"name":"empathic","version":"2.0.0","author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"empathic@2.0.0","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/empathic#readme","bugs":{"url":"https://github.com/lukeed/empathic/issues"},"dist":{"shasum":"71d3c2b94fad49532ef98a6c34be0386659f6131","tarball":"http://registry-npm.ywwl.com/empathic/download/empathic-2.0.0.tgz","fileCount":18,"integrity":"sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==","signatures":[{"sig":"MEUCIQC6nReTwcxOr5MFWIWTwCsQ+pefBBEbOoA7FmI1Z7KubgIgCmo7PJoT+voL+fLKs3Cb0nKGy0NJdw+548oAEEj+4CA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/empathic@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21222,"size":5192,"noattachment":false,"key":"/empathic/-/empathic-2.0.0.tgz"},"engines":{"node":">=14"},"exports":{"./find":{"types":"./find.d.ts","import":"./find.mjs","require":"./find.js"},"./walk":{"types":"./walk.d.ts","import":"./walk.mjs","require":"./walk.js"},"./access":{"types":"./access.d.ts","import":"./access.mjs","require":"./access.js"},"./package":{"types":"./package.d.ts","import":"./package.mjs","require":"./package.js"},"./resolve":{"types":"./resolve.d.ts","import":"./resolve.mjs","require":"./resolve.js"},"./package.json":"./package.json"},"gitHead":"f5f944a06f9a411168a0073c3fe14e517031d098","scripts":{"test":"uvu"},"_npmUser":{"name":"lukeed","actor":{"name":"lukeed","type":"user","email":"luke@lukeed.com"},"email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/empathic.git","type":"git"},"_npmVersion":"10.8.2","description":"A set of small and fast Node.js utilities to understand your pathing needs.","directories":{},"_nodeVersion":"20.19.2","_hasShrinkwrap":false,"devDependencies":{"uvu":"0.5"},"_npmOperationalInternal":{"tmp":"tmp/empathic_2.0.0_1750433965816_0.8345549636911278","host":"s3://npm-registry-packages-npm-production"},"readme":"# empathic [![CI](https://github.com/lukeed/empathic/workflows/CI/badge.svg)](https://github.com/lukeed/empathic/actions?query=workflow%3ACI) [![licenses](https://licenses.dev/b/npm/empathic)](https://licenses.dev/npm/empathic)\n\n> A set of small and [fast](/benchmarks.md) Node.js utilities to understand your pathing needs.\n\nMultiple submodules (eg, `empathic/find`) are offered, _each of which_ are:\n\n* **fast** — 8x to 40x faster than popular alternatives\n* **modern** — based on newer `node:*` native APIs\n* **small** — ranging from 200b to 500b in size\n* **safe** — zero-dependency & easy to read\n\n## Install\n\n```sh\n$ npm install empathic\n```\n\n## Usage\n\n```ts\nimport { resolve } from 'node:path';\nimport * as find from 'empathic/find';\nimport * as pkg from 'empathic/package';\n\n// Assumed example structure:\nlet cwd = resolve('path/to/acme/websites/dashboard');\n\n// Find closest \"foobar.config.js\" file\nlet file = find.up('foobar.config.js', { cwd });\n//=> \"/.../path/to/acme/foobar.config.js\"\n\n// Find closest \"package.json\" file\nlet pkgfile = pkg.up({ cwd });\n//=> \"/.../path/to/acme/package.json\"\n\n// Construct (optionally create) \"foobar\" cache dir\nlet cache = pkg.cache('foobar', { cwd, create: true });\n//=> \"/.../path/to/acme/node_modules/.cache/foobar\"\n```\n\n## API\n\n### `empathic/access`\n\n> [Source](/src/access.ts) · **Size:** `259b`\n\nCheck for file access/permissions. Named [`fs.accessSync`](https://nodejs.org/docs/latest/api/fs.html#fsaccesssyncpath-mode) shortcuts.\n\n### `empathic/find`\n\n> [Source](/src/find.ts) · [Benchmark](/benchmarks.md#find) · **Size:** `569b`\n\nFind files and/or directories by walking up parent directories.\n\n### `empathic/package`\n\n> [Source](/src/package.ts) · [Benchmark](/benchmarks.md#package) · **Size:** `505b`\n\nConvenience helpers for dealing with `package.json` files and/or `node_modules` packages.\n\n### `empathic/resolve`\n\n> [Source](/src/resolve.ts) · [Benchmark](/benchmarks.md#resolve) · **Size:** `419b`\n\nResolve absolute paths to package identifiers, relative paths, file URL, and/or from other root directories.\n\n### `empathic/walk`\n\n> [Source](/src/walk.ts) · [Benchmark](/benchmarks.md#walk) · **Size:** `208b`\n\nCollect all the parent directories of a target. Controlled via `cwd` and `last` options.\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","publish_time":1750433966009,"_cnpm_publish_time":1750433966009,"dist-tags":{"latest":"2.1.0","next":"2.0.0-next.0"}}