acorn-import-assertions
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
acorn | 8.11.3 | 122.89 kB | MIT | prod peer |
Acorn-import-assertions is an npm package that offers support for import assertions in acorn. Import assertions are a new JavaScript feature that allows metadata to be associated with import statements. Acorn is a small, fast, JavaScript-based parsing library, and with this plugin, you can extend Acorn's parsing capabilities to include support for import assertions.
To use acorn-import-assertions, begin by installing it via npm. Once installed, you can execute it with the Acorn Parser utility. An example of this would look like the following JavaScript code:
const {Parser} = require('acorn');
const {importAssertions} = require('acorn-import-assertions');
Parser.extend(importAssertions).parse('...');
In this code, require('acorn')
and require('acorn-import-assertions')
are importing the Acorn Parser utility and the import assertions plugin, respectively. Parser.extend(importAssertions).parse('...')
is using the plugin to extend the capabilities of the parser.
The acorn-import-assertions documentation, including further usage details and related information, can be found directly on the GitHub page for the package, which is: https://github.com/xtuc/acorn-import-assertions.