Socket
Socket
Sign inDemoInstall

@babel/plugin-syntax-import-assertions

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-syntax-import-assertions

Allow parsing of the module assertion attributes in the import statement


Version published
Weekly downloads
20M
decreased by-0.83%
Maintainers
4
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 29 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc