safe-resolve
require.resolve without throwing
Last updated 5 years ago by evanlucas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install safe-resolve 
SYNC missed versions from official npm registry.

safe-resolve

Build Status Coverage Status

require.resolve without throwing

Install

$ npm install --save safe-resolve

Test

$ npm test

Usage

const safe = require('safe-resolve')

// index.js exists
safe('./index.js')
// returns the resolved filepath

// biscuits.js does not exist
safe('./biscuits.js')
// => null

Author

Evan Lucas

License

MIT (See LICENSE for more info)

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

1 Versions

  • 1.0.0                                ...           5 years ago
Maintainers (2)
Downloads
Today 0
This Week 13
This Month 16
Last Day 6
Last Week 67
Last Month 294
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |