{"name":"empathic","version":"2.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/empathic.git"},"description":"A set of small and fast Node.js utilities to understand your pathing needs.","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{"./access":{"import":"./access.mjs","require":"./access.js"},"./find":{"import":"./find.mjs","require":"./find.js"},"./package":{"import":"./package.mjs","require":"./package.js"},"./resolve":{"import":"./resolve.mjs","require":"./resolve.js"},"./walk":{"import":"./walk.mjs","require":"./walk.js"},"./package.json":"./package.json"},"scripts":{"test":"uvu"},"engines":{"node":">=14"},"devDependencies":{"uvu":"0.5"},"gitHead":"71fff27bc4272c668cf350904030c8b275563c82","_id":"empathic@2.0.1","bugs":{"url":"https://github.com/lukeed/empathic/issues"},"homepage":"https://github.com/lukeed/empathic#readme","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==","shasum":"37b1bede31093e04a03d2abce95ea323fee8ef49","tarball":"http://registry-npm.ywwl.com/empathic/download/empathic-2.0.1.tgz","fileCount":23,"unpackedSize":21222,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/empathic@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFazPr6FVDeCAq0psPBQaEoz52kLicmWWGMGi34FuxxYAiEAlnn9wOrl/86WvDGszmTGTMcpzKY6sapbFi+S1Mt0jUg="}],"size":5305,"noattachment":false,"key":"/empathic/-/empathic-2.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8b5ab027-8916-4d3f-8618-dc6921bb33a1"}},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/empathic_2.0.1_1778180595133_0.46268087929715684"},"_hasShrinkwrap":false,"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":1778180595326,"_cnpm_publish_time":1778180595326,"dist-tags":{"latest":"2.1.0","next":"2.0.0-next.0"}}