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

@lbu/stdlib

Package Overview
Dependencies
Maintainers
2
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lbu/stdlib - npm Package Compare versions

Comparing version 0.0.61 to 0.0.62

8

index.d.ts

@@ -185,3 +185,3 @@ import { Logger } from "@lbu/insight";

* exec("uname -m");
* // => Promise<{ stdout: "x86_64\n", stderr: "" }>
* // => Promise<{ stdout: "x86_64\n", stderr: "", exitCode: 0 }>
* ```

@@ -191,3 +191,3 @@ */

command: string,
): Promise<{ stdout: string; stderr: string }>;
): Promise<{ stdout: string; stderr: string; exitCode: number }>;

@@ -199,3 +199,3 @@ /**

* spawn("ls", ["-al"], { cwd: "/home" });
* // => Promise<{ code: 0 }>
* // => Promise<{ exitCode: 0 }>
* ```

@@ -207,3 +207,3 @@ */

opts?: SpawnOptions,
): Promise<{ code?: number }>;
): Promise<{ exitCode: number }>;

@@ -210,0 +210,0 @@ /**

{
"name": "@lbu/stdlib",
"version": "0.0.61",
"version": "0.0.62",
"description": "All kinds of utility functions",

@@ -17,3 +17,3 @@ "main": "./index.js",

"dependencies": {
"@lbu/insight": "0.0.61",
"@lbu/insight": "0.0.62",
"@types/node": "14.6.0",

@@ -44,3 +44,3 @@ "dotenv": "8.2.0",

},
"gitHead": "34d01d169e93516b1b7dd91c97c90d1c5d66cb67"
"gitHead": "1cf32f25700229a1c20488776304a4c05884d88e"
}

@@ -14,6 +14,13 @@ import { exec as cpExec, spawn as cpSpawn } from "child_process";

* @param {string} command
* @returns {Promise<object<{stdout: string, stderr: string}>>}
* @returns {Promise<{stdout: string, stderr: string, exitCode: number}>}
*/
export function exec(command) {
return internalExec(command, { encoding: "utf8" });
export async function exec(command) {
const promise = internalExec(command, { encoding: "utf8" });
const { stdout, stderr } = await promise;
return {
stdout,
stderr,
exitCode: promise.child.exitCode ?? 0,
};
}

@@ -25,3 +32,3 @@

* @param {object} [opts={}]
* @returns {Promise<{code: number|undefined}>}
* @returns {Promise<{exitCode: number}>}
*/

@@ -34,3 +41,3 @@ export function spawn(command, args, opts = {}) {

sp.once("exit", (code) => {
resolve({ code: code === null ? undefined : code });
resolve({ exitCode: code ?? 0 });
});

@@ -37,0 +44,0 @@ });

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