Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

acorn-import-phases

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

acorn-import-phases

Support for `import <defer|source>` phase syntax in Acorn

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
22M
6.74%
Maintainers
1
Weekly downloads
 
Created
Source

Support for import defer and import souce in acorn

Install

npm install acorn-import-phases

Usage

This module provides a plugin that can be used to extend the Acorn Parser class:

const {Parser} = require('acorn');
const importPhases = require('acorn-import-phases');
Parser.extend(importPhases()).parse('...');

By default, the plugin supports both import defer and import source syntax. You can disable one of them by passing an options object:

const {Parser} = require('acorn');
const importPhases = require('acorn-import-phases');
Parser.extend(importPhases({ defer: false })).parse('...');
Parser.extend(importPhases({ source: false })).parse('...');

License

This plugin is released under an MIT License.

Keywords

acorn

FAQs

Package last updated on 14 Jul 2025

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