Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

@babel/plugin-syntax-import-assertions

Package Overview
Dependencies
54
Maintainers
4
Versions
21
Issues
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@babel/plugin-syntax-import-assertions

Allow parsing of the module assertion attributes in the import statement

    7.23.3latest
    GitHub
    npm

Version published
Maintainers
4
Weekly downloads
17,225,457
decreased by-1.91%

Weekly downloads

Package description

What is @babel/plugin-syntax-import-assertions?

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.

What are @babel/plugin-syntax-import-assertions's main functionalities?

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' };

Other packages similar to @babel/plugin-syntax-import-assertions

Changelog

Source

v7.23.3 (2023-11-09)

:bug: Bug Fix
  • babel-plugin-transform-typescript
    • #16071 Strip type-only TS namespaces (@colinaaa)
  • babel-generator
  • babel-compat-data, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly, babel-preset-env
  • babel-plugin-transform-object-super
  • babel-helper-module-transforms, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-umd
:memo: Documentation
  • #16044 docs: Update links in @babel/eslint-parser README (@aryehb)
:house: Internal
  • babel-core, babel-preset-env
:running_woman: Performance
:microscope: Output optimization
  • babel-plugin-transform-computed-properties

Readme

Source

@babel/plugin-syntax-import-assertions

Allow parsing of the module assertion attributes in the import statement

See our website @babel/plugin-syntax-import-assertions for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-syntax-import-assertions

or using yarn:

yarn add @babel/plugin-syntax-import-assertions --dev

Keywords

FAQs

Last updated on 09 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • 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