New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lambduh-execute

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambduh-execute

Execute any shell string via node.exec

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-53.85%
Maintainers
1
Weekly downloads
 
Created
Source

lambduh-execute

Execute any shell string via node.exec

Usage

Two sample use-cases shown here:

var Q = require('q');
var execute = require('lambduh-execute');

//your lambda function
exports.handler = function(event, context) {
  var promises = [];
  
  promises.push(execute({
    shell: "echo `ls /tmp/`",
    showOutput: true
  }) // logs output of /tmp/ dir on your lambda machine
  
  promises.push(execute({
    shell: "cp /var/task/ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg",
    showOutput: true
  }) // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
  
  promises.push(function(options) {
    context.done()
  })
  
  promises.reduce(Q.when, Q())
    .fail(function(err) {
      console.log("derp");
      console.log(err);
      context.done(null, err);
    });
}

This module takes a script object that can have two fields: a shell field for writing a string of unix commands to be executed, and a showOutput boolean for showing the stdout and stderr logs.

showOutput defaults to false.

The tests in this repo could use enforcement around showOutput - I'm onto bigger fish for now, will hopefully get back to it.

Keywords

FAQs

Package last updated on 15 Mar 2015

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

  • 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