Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@marcopeg/utils

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marcopeg/utils - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/get-error-origin.js

4

index.js
const config = require('./lib/config')
const pause = require('./lib/pause')
const getErrorOrigin = require('./lib/get-error-origin')
module.exports = {
config,
pause,
getErrorOrigin,
}

2

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc