Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-emscripten

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-emscripten

Compile emscripten c/c++ files and create ES6 modules

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Ember-CLI Emscripten

ember-cli-emscripten allows you to add emscripten-flavored c or c++ code to your ember app, then require the exposed functions and classes.

Installation

ember install:addon ember-cli-emscripten

Usage

This addon uses emscripten's (embind)[http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/ embind.html] to expose c/c++ functions to javascript. From the emscripten example:

#include <emscripten/bind.h>

using namespace emscripten;

float lerp(float a, float b, float t) {
    return (1 - t) * a + t * b;
}

EMSCRIPTEN_BINDINGS(my_module) {
    function("lerp", &lerp);
}

ember-cli-emscripten then exports lerp via ES6, so you could use it like so:

import lerp from 'ember-app/compiled/lerp';

lerp.lerp(1, 2.5, 5)

TODO

  • Right now every cpp file that gets compiled to js includes the emscripten runtime. Ideally this should only be included once per project.
  • Expose emscripten emcc optimization options.

License

See LICENSE.

Keywords

FAQs

Package last updated on 03 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