Socket
Socket
Sign inDemoInstall

acorn-dynamic-import

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    acorn-dynamic-import

Support dynamic imports in acorn


Version published
Weekly downloads
972K
decreased by-4.62%
Maintainers
1
Install size
577 kB
Created
Weekly downloads
 

Changelog

Source

2.0.2

  • Fixing parsing of yield import().

Readme

Source

Dynamic import support in acorn

This is plugin for Acorn - a tiny, fast JavaScript parser, written completely in JavaScript.

For more information, check out the proposal repo.

Usage

You can use this module directly in order to get Acorn instance with plugin installed:

import acorn from 'acorn-dynamic-import';
// or...
const acorn = require('acorn-dynamic-import').default;

Or you can use inject.js for injecting plugin into your own version of Acorn like this:

const acorn = require('acorn-dynamic-import/lib/inject').default(require('./custom-acorn'));

Then, use the plugins option whenever you need to support dynamicImport while parsing:

const ast = acorn.parse(code, {
  plugins: { dynamicImport: true }
});

License

This plugin is issued under the MIT license.

FAQs

Last updated on 28 Feb 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc