A collection of day-to-day utility methods specifically for Node environment
Last updated a year ago by harrison-ifeanyichukwu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @forensic-js/node-utils 
SYNC missed versions from official npm registry.


Build Status Coverage Status semantic-release npm version npm

Node-Utils is a collection of day-to-day utility methods usable in both node and browser environments. It is developed for reusability purpose and for fast project development, letting you focus on what matters in your application.

Because it is a typescript project, you get excellent auto-completion and type checks.


npm install @forensic-js/node-utils

Usage Sample

import {getEntryPath, isProdEnv, isDevEnv. isTestEnv, mkDirSync} from '@forensic-js/node-utils';

process.env.NODE_ENV = 'production';
console.log(isProdEnv()); //logs true

process.env.NODE_ENV = 'test';
console.log(isTestEnv()); //true
console.log(isDevEnv()); //returns true as long as env is not in production

process.env.NODE_ENV = '';
console.log(isTestEnv()); //false
console.log(isDevEnv()); //true

//iteratively creates the folder is it does not exist
mkDirSync('a directory or file path');

//gets the project root directory by inspection

Current Tags

  • 1.0.2                                ...           latest (a year ago)

3 Versions

  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 3
Dependencies (2)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |