Package Exports
- @teclone/node-utils
- @teclone/node-utils/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@teclone/node-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Node-Utils
Node-Utils is a collection of day-to-day utility methods usable in node environments.
Installation
npm install @teclone/node-utilsgetClosesetPackageDir(startPath: string = process.cwd())
This function returns the absolute path of the closest directory that contains a package.json file.
It will return startPath if startPath contains a package.json file as well.
import { getClosestPackageDir } from '@teclone/node-utils';
console.log(getClosestPackageDir());mkdirSync(path: string)
Recursively creates the path given. If path points to a file, only the directories will be created.
import { mkdirSync } from '@teclone/node-utils';
mkdirSync('/projects/examples/test.ts');
// the directory path /projects/examples will be created