Socket
Book a DemoInstallSign in
Socket

@gasket/utils

Package Overview
Dependencies
Maintainers
2
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasket/utils

Reusable utilities for Gasket internals

5.0.0-canary.1
Source
npmnpm
Version published
Weekly downloads
27
22.73%
Maintainers
2
Weekly downloads
 
Created
Source

@gasket/utils

Reusable utilities for Gasket internals

Installation

npm i @gasket/utils

Functions

tryRequire

Tries to require a module, but ignores if it is not found. If not found, result will be null.

const { tryRequire } = require('@gasket/utils');

let someConfig = tryRequire('../might/be/a/path/to/some/file');

if(!someConfig) {
  someConfig = require('./default-config')
}

applyEnvironmentOverrides

Normalize the config by applying any environment or local overrides.

runShellCommand

Promise friendly wrapper to running a shell command (eg: git, npm, ls).

  • runShellCommand(command[, args][, options])
const { runShellCommand } = require('@gasket/utils');

async function helloWorld() {
  await runShellCommand('echo', ['hello world']);
}

License

MIT

Keywords

gasket

FAQs

Package last updated on 03 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.