{"id":15716682,"url":"https://github.com/styfle/exeggcute","last_synced_at":"2025-07-10T15:38:07.703Z","repository":{"id":143878575,"uuid":"63953497","full_name":"styfle/exeggcute","owner":"styfle","description":"🥚 A node.js module to make executing shell cmds a breeze!","archived":false,"fork":false,"pushed_at":"2017-06-13T16:14:38.000Z","size":28,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T05:11:43.064Z","etag":null,"topics":["command-line","execute","execution","executor"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styfle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-22T12:58:52.000Z","updated_at":"2020-08-04T21:41:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3bc7a31-abc0-4e09-a24e-0bba24e1a39a","html_url":"https://github.com/styfle/exeggcute","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fexeggcute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fexeggcute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fexeggcute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fexeggcute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styfle","download_url":"https://codeload.github.com/styfle/exeggcute/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253463991,"owners_count":21912903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","execute","execution","executor"],"created_at":"2024-10-03T21:46:31.743Z","updated_at":"2025-05-13T00:42:31.302Z","avatar_url":"https://github.com/styfle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exeggcute\n\n[![Version](https://img.shields.io/npm/v/exeggcute.svg)](https://www.npmjs.com/package/exeggcute)\n[![Downloads](https://img.shields.io/npm/dt/exeggcute.svg)](https://www.npmjs.com/package/exeggcute)\n\nA node.js module to make executing shell commands a breeze!\n\nIt simply wraps [child_process.exec](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) with a promise so there are *zero dependencies* besides node!\n\n![img](http://cdn.bulbagarden.net/upload/a/af/102Exeggcute.png)\n\n\n## Installation\n\nUse npm as usual to save the package to your dependencies:\n\n```sh\nnpm install --save exeggcute\n```\n\n## Usage\n\nWindows (note the directory)\n```js\nconst exec = require('exeggcute').exec;\nvar dir = 'c:/code/';\nvar cmd = 'git clone https://github.com/styfle/exeggcute';\nexec(cmd, dir);\n```\n\n\nLinux (note the directory)\n```js\nconst exec = require('exeggcute').exec;\nvar dir = '/code/';\nvar cmd = 'git clone https://github.com/styfle/exeggcute';\nexec(cmd, dir);\n```\n\nES6 Import (note the import)\n```js\nimport {exec} from 'exeggcute';\nvar dir = '/code/';\nvar cmd = 'git clone https://github.com/styfle/exeggcute';\nexec(cmd, dir);\n```\n\n## What's with the name?\n\nThe name `exeggcute` is named after the pokemon, Exeggcute. You can see more code/projects named after pokemon at [repokemon](https://cheeaun.github.io/repokemon/).\n\n## Why did you make this?\n\nI wanted to execute a chain of commands that reads nicely and not worry about syntax. The node core APIs do not use promises so it's easy to get into [callback hell](http://callbackhell.com/). `exeggcute` makes it easy to write a RESTful API that executes several commands in a row and fails if any one command in the chain fails.\n\n### Advanced Usage Example\nBelow is an example that mirrors code from the `originRepo` to the `targetRepo`.\nThis 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`.\n\n```js\nhasDir(repoDir)\n    .then(exists =\u003e {\n        if (!exists) {\n            return exec(`git clone ${originRepo}`, baseDir)\n                .then(() =\u003e exec(`git remote add target ${targetRepo}`, repoDir))\n        }\n        return Promise.resolve(exists);\n    })\n    .then(() =\u003e exec(`git checkout ${branch}`, repoDir))\n    .then(() =\u003e exec(`git pull origin ${branch}`, repoDir))\n    .then(() =\u003e exec(`git push target ${branch}`, repoDir))\n    .then(() =\u003e exec(`git pull origin --tags`, repoDir))\n    .then(() =\u003e exec(`git push target --tags`, repoDir))\n    .catch((err) =\u003e console.error('Oh no! ', err));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyfle%2Fexeggcute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyfle%2Fexeggcute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyfle%2Fexeggcute/lists"}