Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
@babel/plugin-syntax-import-assertions
Advanced tools
Allow parsing of the module assertion attributes in the import statement
The @babel/plugin-syntax-import-assertions package allows Babel to parse the import assertions syntax, which is a feature that enables developers to make assertions about the kind of content they are importing. This is particularly useful for ensuring that modules being imported are of the expected type, such as JSON, HTML, or other non-JavaScript resources.
Parsing import assertions
This feature allows Babel to understand and parse the import assertions syntax, which is used to assert the type of file being imported. In this code sample, an assertion is made that the imported module 'data.json' is of type 'json'.
import json from './data.json' assert { type: 'json' };
This package allows Babel to transform JSON string literals into actual JSON objects. It is similar to @babel/plugin-syntax-import-assertions in that it deals with JSON within the context of JavaScript modules, but it focuses on the transformation of JSON strings rather than the import assertions syntax.
Allow parsing of the module assertion attributes in the import statement
See our website @babel/plugin-syntax-import-assertions for more information.
Using npm:
npm install --save-dev @babel/plugin-syntax-import-assertions
or using yarn:
yarn add @babel/plugin-syntax-import-assertions --dev
v7.23.3 (2023-11-09)
babel-plugin-transform-typescript
babel-generator
concise: true
(@liuxingbaoyu)babel-compat-data
, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly
, babel-preset-env
babel-plugin-transform-object-super
super.x
in a loop (@liuxingbaoyu)babel-helper-module-transforms
, babel-plugin-transform-modules-amd
, babel-plugin-transform-modules-commonjs
, babel-plugin-transform-modules-umd
__proto__
exports name in CJS/AMD/UMD (@magic-akari)babel-core
, babel-preset-env
preset-env
(@nicolo-ribaudo)babel-generator
@babel/generator
performance (@liuxingbaoyu)babel-traverse
FAQs
Allow parsing of the module assertion attributes in the import statement
We found that @babel/plugin-syntax-import-assertions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
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.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.