Socket
Socket
Sign inDemoInstall

exeggcute

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

exeggcute

A node.js module to make executing shell cmds a breeze!


Version published
Maintainers
1
Weekly downloads
79
increased by68.09%

Weekly downloads

Readme

Source

exeggcute

A node.js module to make executing shell cmds a breeze!

img

Installation

Use npm as usual to save the package to your dependencies:

npm install --save exeggcute

Usage

Windows

const exec = require('exeggcute').exec;
var dir = 'c:/code/';
var cmd = 'git clone https://github.com/styfle/exeggcute';
exec(cmd, dir);

Linux

const exec = require('exeggcute').exec;
var dir = '/code/';
var cmd = 'git clone https://github.com/styfle/exeggcute';
exec(cmd, dir);

ES6 Import

import {exec} from 'exeggcute';
var dir = '/code/';
var cmd = 'git clone https://github.com/styfle/exeggcute';
exec(cmd, dir);

What's with the name?

exeggcute is named after the pokemon, Exeggcute. You can see more code/projects named after pokemon at repokemon.

Why did you make this?

I wanted to execute a chain of commands that reads nicely and not worry about syntax.

Below is an example that mirrors code from the originRepo to the targetRepo. This is a hook that runs for each push of a branch or tag to the originRepo and will then push that branch/tag to the targetRepo.

hasDir(repoDir)
    .then(exists => {
        if (!exists) {
            return exec(`git clone ${originRepo}`, baseDir)
                .then(() => exec(`git remote add target ${targetRepo}`, repoDir))
        }
        return Promise.resolve(exists);
    })
    .then(() => exec(`git checkout ${branch}`, repoDir))
    .then(() => exec(`git pull origin ${branch}`, repoDir))
    .then(() => exec(`git push target ${branch}`, repoDir))
    .then(() => exec(`git pull origin --tags`, repoDir))
    .then(() => exec(`git push target --tags`, repoDir))
    .catch((err) => console.error('Oh no! ', err));

Keywords

FAQs

Last updated on 22 Jul 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc