https://github.com/teclone/node-utils
A collection of day-to-day utility methods specifically for Node environment
https://github.com/teclone/node-utils
Last synced: 9 months ago
JSON representation
A collection of day-to-day utility methods specifically for Node environment
- Host: GitHub
- URL: https://github.com/teclone/node-utils
- Owner: teclone
- License: mit
- Created: 2019-05-05T14:49:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:05:31.000Z (over 3 years ago)
- Last Synced: 2025-08-08T16:44:46.109Z (11 months ago)
- Language: TypeScript
- Size: 3.94 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node-Utils
[](https://travis-ci.org/harrison-ifeanyichukwu/node-utils)
[](https://coveralls.io/github/harrison-ifeanyichukwu/node-utils?branch=master)
[](https://github.com/semantic-release/semantic-release)
[](https://badge.fury.io/js/%40teclone%2Fnode-utils)

Node-Utils is a collection of day-to-day utility methods usable in node environments.
## Installation
```bash
npm install @teclone/node-utils
```
## Usage Sample
```typescript
import {getEntryPath, isProdEnv, isDevEnv. isTestEnv, mkDirSync} from '@teclone/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();
```