Get the name of the parent folder.
For the given path return the name of the most immediate parent folder. Useful for scripts and generators where you want to use the parent folder name in some way (project naming, etc).
npm install --save parent-folder
var parentFolder = ;// Assuming we're currently in: /foo/bar/index.js// Defaults to current file of call://=> 'bar'// Passing in a path to a folder://=> 'here'// If using in a path to a file, make sure to// pass in `true` flag as the second parameter.//=> 'project'
See the API docs for full documentation.
Pull requests welcome!
Please use the
.eslintrc configurations in your editor to ensure proper formatting.
Run the test suite with
npm test and linting with
npm run lint, make sure tests are passing and that you write tests for new features.