@teclone/node-utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Node-Utils

Build Status Coverage Status semantic-release npm version npm

Node-Utils is a collection of day-to-day utility methods usable in node environments.

Installation

npm install @teclone/node-utils

getClosesetPackageDir(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

/@teclone/node-utils/

    Package Sidebar

    Install

    npm i @teclone/node-utils

    Weekly Downloads

    1

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    21.2 kB

    Total Files

    17

    Last publish

    Collaborators

    • teclone