Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eldoy/itility
Utility functions for things you need all the time in node
https://github.com/eldoy/itility
Last synced: 6 days ago
JSON representation
Utility functions for things you need all the time in node
- Host: GitHub
- URL: https://github.com/eldoy/itility
- Owner: eldoy
- License: mit
- Created: 2018-10-17T02:22:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-20T16:14:48.000Z (about 6 years ago)
- Last Synced: 2024-09-17T00:24:22.781Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Itility node utility functions
Utility functions for things you need all the time in node.
### INSTALL
```npm i itility``` or ```yarn add itility```### FUNCTIONS
#### Environment mode
Get strings based on the NODE_ENV you are in.
```javascript
const { mode } = require('itility')// development: mongodb://localhost:27017
// production: mongodb://mongo:27017
const url = mode('mongodb://*:27017', 'localhost', 'mongo')// Same result, different method
const url = mode('*', 'mongodb://localhost:27017', 'mongodb://mongo:27017')// Same result, shared port
const url = mode('*:27017', 'mongodb://localhost', 'mongodb://mongo')// staging: mongodb://staging:27017
const url = mode('mongodb://*:27017', 'localhost', 'staging', 'mongo')
```MIT licensed. Enjoy!