function-path
v0.1.1
Published
Require functions and child objects from JavaScript modules.
Downloads
17
Readme
Function Path
With function-path
you can deep link into functions and nested objects.
Install
$ > yarn add function-path
$ > npm install function-path
Usage
Let's say you have a file scripts/output.js
with the following contents:
function handler () {
return 'yeah'
}
module.exports.nested = { handler }
You can access the handler
function using function-path
with scripts/output.nested.handler
:
const handler = require('function-path').require('scripts/output.nested.handler')
License
Feel free to use the code, it's released using the MIT license.
Contribution
You are more than welcome to contribute to this project! 😘 🙆
To make sure you have a pleasant experience, please read the code of conduct. It outlines core values and believes and will make working together a happier experience.