@marcopeg/utils
Advanced tools
Comparing version 1.0.0 to 1.0.1
const config = require('./lib/config') | ||
const pause = require('./lib/pause') | ||
const getErrorOrigin = require('./lib/get-error-origin') | ||
module.exports = { | ||
config, | ||
pause, | ||
getErrorOrigin, | ||
} |
{ | ||
"name": "@marcopeg/utils", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Javascript utils for server and client projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# utils | ||
Javascript utils for server and client projects | ||
## config | ||
``` | ||
const config = require('@marcopeg/utils/lib/config) | ||
// will trigger an error if the env variable is not defined | ||
const serverPort = config.get('SERVER_PORT') | ||
// will return a default vailue if the env variable is not defined | ||
const appName = config.get('APP_NAME', 'Default App Name') | ||
// (process.env.NODE_ENV === 'development') | ||
if (config.isDev()) { | ||
... | ||
} | ||
``` | ||
## pause | ||
``` | ||
const pause = require('@marcopeg/utils/lib/pause) | ||
async function foo () { | ||
console.log('before') | ||
await pause(2000) // stop process for 2s | ||
console.log('after') | ||
} | ||
``` | ||
## getErrorOrigin | ||
Improve errors stack trace |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3790
7
48
36