New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-wrap

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-wrap

Import node modules that use ES6 into your Ember projects

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

ember-wrap

Note: this isn't an Ember addon, it's a shell script. :stuck_out_tongue:

ember-wrap is a shell script that transforms node modules into standalone JavaScript files. It is a workaround for some of ember-browserify's shortcomings, namely trouble with transpiling ES6 syntax and poor compatibility with addons. Once the standalone JS files are generated, you can move them to vendor/ and import them in your ember-cli-build.js as usual.

Install

$ npm install -g ember-wrap

Example

Let's try installing git-data, which is a module that uses ES6.

Within an Ember project:

$ npm install git-data
$ wrap git-data
$ ls vendor/ # now has git-data.js and git-data-shim.js

Add the following to your ember-cli-build.js:

app.import('vendor/git-data.js')
app.import('vendor/git-data-shim.js')

And import the module freely in your Ember project:

import GitData from 'git-data'
window['git-data'] // => undefined

If necessary, you can run wrap in npm's postinstall hook. This is useful if you want to keep a dependency up-to-date.

// place this in package.json
{
  "scripts": {
    "postinstall": "wrap git-data"
  }
}

Docs


  Usage: wrap [options] <module>

  Options:

    -o, --outdir <dirname>    [default: vendor/]

      Output directory.

  Examples:

    Note that the modules below use ES6 features.

    $ npm install git-data
    $ wrap git-data

    $ npm install joi
    $ wrap joi

    $ wrap --outdir somedir/ joi

License

MIT

FAQs

Package last updated on 19 Oct 2016

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