# emcc

> A simple c-compiler caller for node

Latest version **0.2.2** (published 2018-12-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install emcc
pnpm add emcc
yarn add emcc
bun add emcc
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2018-12-26 |
| First published | 2018-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | René Hickersberger |
| Maintainers | renehsz |
| Keywords | emscripten, webassembly, wasm, emcc, em++, c, c-compiler, c++, c++-compiler |

## Links

- npm: https://www.npmjs.com/package/emcc
- Repository: https://github.com/ReneHSZ/node-emcc
- Homepage: https://github.com/ReneHSZ/node-emcc#readme
- Issues: https://github.com/ReneHSZ/node-emcc/issues
- npm.io page: https://npm.io/package/emcc

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [globby](https://npm.io/package/globby.md) ^8.0.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2
- [nodegit](https://npm.io/package/nodegit.md) ^0.23.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2018-12-26
- 0.2.1 — 2018-04-29
- 0.2.0 — 2018-04-29
- 0.1.1 — 2018-04-29
- 0.1.0 — 2018-04-29

## README

# node-emcc
A simple Emscripten downloader and runner library for node.

## Usage
Make sure you have all dependencies listed at [http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#platform-specific-notes](http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#platform-specific-notes)

`npm install --save-dev emcc`

```js
const path = require('path');
const emcc = require('emcc');

const inputFile = path.join(__dirname, 'src', 'test.c');
const outputFile = path.join(__dirname, 'out', 'test.js');

// Create output directory if it does not exist
require('mkdirp').sync(path.dirname(outputFile));

// Run the emscripten compiler
emcc(`-s WASM=1 ${inputFile} -o ${outputFile}`, (err, stdout, stderr) => {
    // If there is an error, throw it
    if (err != null || stderr.trim() != '') {
        console.error(stderr);
        throw err;
    }

    // Log the compiler output
    console.log(stdout);
});
```

## License
MIT License. See [LICENSE](LICENSE) file.

---
_Source: https://npm.io/package/emcc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
