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

@bifravst/run

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bifravst/run - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

3

dist/run.d.ts
/// <reference types="node" resolution-mode="require"/>
declare const run: ({ command, args, input, log, cwd, }: {
declare const run: ({ command, args, input, log, cwd, env, }: {
command: string;

@@ -7,2 +7,3 @@ args?: string[];

cwd?: string;
env?: Record<string, string>;
log?: {

@@ -9,0 +10,0 @@ debug?: (...message: string[]) => void;

import { spawn } from 'node:child_process';
import os from 'node:os';
const run = async ({ command, args, input, log, cwd, }) => new Promise((resolve, reject) => {
const run = async ({ command, args, input, log, cwd, env, }) => new Promise((resolve, reject) => {
log?.debug?.(`${command} ${args?.join(' ')}`);
const p = spawn(command, args, { cwd });
const p = spawn(command, args, { cwd, env });
const result = [];

@@ -7,0 +7,0 @@ const errors = [];

@@ -68,2 +68,12 @@ import { describe, it, mock } from 'node:test';

});
void it('can be passed environment variables', async () => {
const res = await run({
command: '/bin/bash',
args: ['-c', 'echo $FOO'],
env: {
FOO: 'bar',
},
});
assert.equal(res, `bar${os.EOL}`);
});
});
{
"name": "@bifravst/run",
"version": "1.1.1",
"version": "1.2.0",
"description": "run() wraps Node.js' spawn()",

@@ -5,0 +5,0 @@ "exports": {

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