Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
@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.25.7 (2024-10-02)
babel-helper-validator-identifier
babel-traverse
babel-plugin-transform-classes
super()
check (@nicolo-ribaudo)babel-generator
infer
in compact mode (@nicolo-ribaudo)[no LineTerminator here]
after nodes (@nicolo-ribaudo)babel-types
babel-core
--experimental-require-module
(@nicolo-ribaudo)babel-helper-compilation-targets
, babel-helper-plugin-utils
, babel-preset-env
babel-plugin-proposal-destructuring-private
, babel-plugin-syntax-decimal
, babel-plugin-syntax-import-reflection
, babel-standalone
babel-generator
[no LineTerminator here]
before nodes (@nicolo-ribaudo)babel-plugin-transform-typescript
babel-types
BABEL_TYPES_8_BREAKING
at startup (@nicolo-ribaudo)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.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.