{"id":15698943,"url":"https://github.com/doowb/resolve-file","last_synced_at":"2025-05-08T22:22:26.375Z","repository":{"id":57354690,"uuid":"40053541","full_name":"doowb/resolve-file","owner":"doowb","description":"Resolve an absolute file path from local directories or node modules.","archived":false,"fork":false,"pushed_at":"2016-12-31T04:09:17.000Z","size":27,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T10:42:21.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-01T16:55:09.000Z","updated_at":"2021-04-12T22:00:22.000Z","dependencies_parsed_at":"2022-09-12T03:40:12.525Z","dependency_job_id":null,"html_url":"https://github.com/doowb/resolve-file","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fresolve-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fresolve-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fresolve-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fresolve-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/resolve-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253155581,"owners_count":21862725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T19:36:18.046Z","updated_at":"2025-05-08T22:22:26.355Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resolve-file [![NPM version](https://img.shields.io/npm/v/resolve-file.svg?style=flat)](https://www.npmjs.com/package/resolve-file) [![NPM downloads](https://img.shields.io/npm/dm/resolve-file.svg?style=flat)](https://npmjs.org/package/resolve-file) [![Linux Build Status](https://img.shields.io/travis/doowb/resolve-file.svg?style=flat\u0026label=Travis)](https://travis-ci.org/doowb/resolve-file) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/resolve-file.svg?style=flat\u0026label=AppVeyor)](https://ci.appveyor.com/project/doowb/resolve-file)\n\n\u003e Resolve an absolute file path from local directories, local node_modules or global node_modules.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save resolve-file\n```\n\n## Usage\n\n```js\nvar resolveFile = require('resolve-file');\n```\n\n## API\n\n### [resolve](index.js#L33)\n\nResolve the path to a file located in one of the following places:\n\n* local to the current project (`'./index.js'`)\n* absolute (`'/usr/something.rc'`)\n* node module \"main\" file (`'cwd'`)\n* specific file inside a node module (`'cwd/LICENSE'`)\n* file located in user's home directory (`'~/.npmrc'`)\n\n**Example**\n\n```js\nvar fp = resolve('./index.js')\n//=\u003e /path/to/resolve-file/index.js\n```\n\n**Params**\n\n* `name` **{String}**: Filename to resolve\n* `options` **{Object}**: Additional options to specify `cwd`\n* `returns` **{String}**: Resolved `filepath` if found\n\n### [.file](index.js#L61)\n\nResolve the path to a file located in one of the following places:\n\n* local to the current project (`'./index.js'`)\n* absolute (`'/usr/something.rc'`)\n* node module \"main\" file (`'cwd'`)\n* specific file inside a node module (`'cwd/LICENSE'`)\n* file located in user's home directory (`'~/.npmrc'`)\n\n**Example**\n\n```js\nvar file = resolve.file('./index.js')\n//=\u003e {\n//=\u003e   cwd: '/path/to/resolve-file',\n//=\u003e   path: '/path/to/resolve-file/index.js'\n//=\u003e }\n```\n\n**Params**\n\n* `name` **{String}**: Filename to resolve\n* `options` **{Object}**: Additional options to specify `cwd`\n* `returns` **{Object}**: File object with resolved `path` if found.\n\n## About\n\n### Related projects\n\n* [cwd](https://www.npmjs.com/package/cwd): Easily get the CWD (current working directory) of a project based on package.json, optionally starting… [more](https://github.com/jonschlinkert/cwd) | [homepage](https://github.com/jonschlinkert/cwd \"Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)\")\n* [expand-tilde](https://www.npmjs.com/package/expand-tilde): Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the… [more](https://github.com/jonschlinkert/expand-tilde) | [homepage](https://github.com/jonschlinkert/expand-tilde \"Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the user home directory, or `~+` to the cwd.\")\n* [look-up](https://www.npmjs.com/package/look-up): Faster drop-in replacement for find-up and findup-sync. | [homepage](https://github.com/jonschlinkert/look-up \"Faster drop-in replacement for find-up and findup-sync.\")\n* [resolve](https://www.npmjs.com/package/resolve): resolve like require.resolve() on behalf of files asynchronously and synchronously | [homepage](https://github.com/substack/node-resolve#readme \"resolve like require.resolve() on behalf of files asynchronously and synchronously\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor**\u003cbr/\u003e | \n| --- | --- |\n| 13 | [doowb](https://github.com/doowb) |\n| 7 | [jonschlinkert](https://github.com/jonschlinkert) |\n\n### Building docs\n\n_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_\n\nTo generate the readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install -g verb verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](http://twitter.com/doowb)\n\n### License\n\nCopyright © 2016, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT license](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 19, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fresolve-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Fresolve-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fresolve-file/lists"}