3.0.0 • Published 6 years ago

resolve-cwd v3.0.0

Weekly downloads
17,938,846
License
MIT
Repository
github
Last release
6 years ago

resolve-cwd Build Status

Resolve the path of a module like require.resolve() but from the current working directory

Install

$ npm install resolve-cwd

Usage

const resolveCwd = require('resolve-cwd');

console.log(__dirname);
//=> '/Users/sindresorhus/rainbow'

console.log(process.cwd());
//=> '/Users/sindresorhus/unicorn'

console.log(resolveCwd('./foo'));
//=> '/Users/sindresorhus/unicorn/foo.js'

API

resolveCwd(moduleId)

Like require(), throws when the module can't be found.

resolveCwd.silent(moduleId)

Returns undefined instead of throwing when the module can't be found.

moduleId

Type: string

What you would use in require().

Related

  • resolve-from - Resolve the path of a module from a given path
  • import-from - Import a module from a given path
  • import-cwd - Import a module from the current working directory
  • resolve-pkg - Resolve the path of a package regardless of it having an entry point
  • import-lazy - Import a module lazily
  • resolve-global - Resolve the path of a globally installed module

License

MIT © Sindre Sorhus

import-localfree-minarchetype-library@case-app/case-clicomponennentt@casejs/case-clieasy-select-rnvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-image@nujek/clispecify-importsbabel-specify-imports@icanpm/api-masterwebpack-cli-lernahypatia-jschrisereact-native-template-rfbaseairscanairscan-examplereadytest-testcafebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@lysander6/directusdeneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationdatoapireact-native-covid-sdkgql_din_mod@zycli/depsbitget@thinkdeep/deep-graphql-binding@l1nyanm1ng/react-picture-viewer@dacio/graphql-bindingcthpb-plugin-socialdirectus9-lite@olivervorasai/sliderreact-native-printer-brotherscbmis-ai-toolboxreact-native-shekhar-bridge-test@ezziepos-commerce/ezziepos-clicogoportutilslevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29module-federation-webpack-pluginwilscanner@oiti/documentoscopy-react-nativejs4cytoscape@mink-opn/build-tokensquoc-testreact-native-slider-kfunblock-block-save-variablescclibyarntesthyperpass-sdkplginexpand-react-bridgeluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-2657jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uireact-native-jawwy_samplegriffin-ui-librarynebula-http-resiliencycomposizedrpdwn-mntaman-baca-masyarakattailwind-vector-effectsyncbackbasessynqueittest-carosello-campustest-library-123test-haptik-libwinx-form-winxwhitegarddenweex-vue-bundle-utilwepwep-cliwithhold-message-avawiwi-serverwodax-umiwontbreak
3.0.0

6 years ago

2.0.0

8 years ago

1.0.0

9 years ago