{"id":19560622,"url":"https://github.com/zoubin/custom-resolve","last_synced_at":"2026-05-27T16:32:36.491Z","repository":{"id":33970896,"uuid":"37709722","full_name":"zoubin/custom-resolve","owner":"zoubin","description":"Sugar way to customize substack's resolve","archived":false,"fork":false,"pushed_at":"2015-12-01T06:45:42.000Z","size":27,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-19T17:17:33.303Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-19T08:03:44.000Z","updated_at":"2025-05-25T11:53:54.000Z","dependencies_parsed_at":"2022-07-13T21:43:44.949Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/custom-resolve","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/custom-resolve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fcustom-resolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fcustom-resolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fcustom-resolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fcustom-resolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/custom-resolve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fcustom-resolve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33575511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-11T05:08:17.442Z","updated_at":"2026-05-27T16:32:36.472Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# custom-resolve\n[![version](https://img.shields.io/npm/v/custom-resolve.svg)](https://www.npmjs.org/package/custom-resolve)\n[![status](https://travis-ci.org/zoubin/custom-resolve.svg?branch=master)](https://travis-ci.org/zoubin/custom-resolve)\n[![coverage](https://img.shields.io/coveralls/zoubin/custom-resolve.svg)](https://coveralls.io/github/zoubin/custom-resolve)\n[![dependencies](https://david-dm.org/zoubin/custom-resolve.svg)](https://david-dm.org/zoubin/custom-resolve)\n[![devDependencies](https://david-dm.org/zoubin/custom-resolve/dev-status.svg)](https://david-dm.org/zoubin/custom-resolve#info=devDependencies)\n\nReturn a function works like substack's [`node-resolve`], with some options set by default.\n\n## Example\n\n```\n⌘ tree example/\nexample/\n├── node_modules\n│   └── colors\n│       ├── colors.scss\n│       └── package.json\n├── resolve.js\n└── style_modules\n    └── red\n        └── index.scss\n```\n\nexample/node_modules/colors/package.json:\n```json\n{\n  \"style\": \"colors\"\n}\n```\n\nexample/resolve.js:\n\n```javascript\nvar resolver = require('..')\nvar path = require('path')\n\nvar resolve = resolver({\n  main: 'style',\n  extensions: ['.scss'],\n})\n\nresolve('colors', function (err, file) {\n  console.log(path.relative(__dirname, file))\n})\n\nconsole.log(\n  path.relative(__dirname, resolve.sync('./red', {\n    basedir: path.join(__dirname, 'style_modules'),\n  }))\n)\n\n```\n\noutput:\n\n```\n⌘ node example/resolve.js\nstyle_modules/red/index.scss\nnode_modules/colors/colors.scss\n\n```\n\n## Breaking changes in v1.0.0\n\n* The options specified will be treated as the default options for [`node-resolve`], and when the returned custom resolve function called, options passed to it will **overwrite** the corresponding default options.\n* The `packageEntry` option is replaced by `main`.\n* The `symlinks` option is replaced by `symlink`. Check [`symlink`](#symlink) for more details.\n* The API only receives one argument.\n\n## resolve = resolver(defaultOptions)\n\nReturn a function like [`node-resolve`],\nwith some of the options set by default according to `defaultOptions`.\n\nWhen `resolve` is called with extra options,\nthey **overwrite** those in `defaultOptions`.\n\nBesides all options supported by [`node-resolve`],\n`defaultOptions` supports the following options.\n\nRefer to [`node-resolve`] for more information about supported options.\n\n### main\nSpecify the package entry.\nIf `defaultOptions` is `String`, it is treated as the `main` option.\n\nType: `String`\n\nDefault: `main`\n\n### filename\nSpecify the file path where to start resolving.\n\nIt is meant to make setting the `basedir` option conveniently.\n\nType: `String`\n\n### symlink\nSpecify how to treat symlinks in the top `node_modules` directory.\n\nType: `true`\n\nAll symlinks will be resolved to their realpaths.\n\nType: `Array`, `String`\n\nOnly those specified will be resolved to realpaths.\n\nType: `Function`\n\nSignature: `needRealpath = symlink(file)`\n\nRealpaths are used only when this function returns a truthy value.\n\n[`node-resolve`]: https://github.com/substack/node-resolve\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fcustom-resolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fcustom-resolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fcustom-resolve/lists"}