This package has been deprecated

Author message:

'no

emcc
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

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

npm install --save-dev emcc

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 file.

Package Sidebar

Install

npm i emcc

Weekly Downloads

4

Version

0.2.2

License

MIT

Unpacked Size

17.5 kB

Total Files

17

Last publish

Collaborators

  • npm