@forensic-js/node-utils
A collection of day-to-day utility methods specifically for Node environment
Last updated 8 months 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.

Node-Utils

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.

Installation

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
getEntryPath();

Current Tags

  • 1.0.0                                ...           latest (8 months ago)

1 Versions

  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (2)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |