Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-import-meta

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-import-meta

Transforms import.meta for nodejs environments

  • 2.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
290K
increased by23.7%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-import-meta

Transforms import.meta for nodejs environments. This plugin replaces any occurrence of import.meta.url.

console.log(import.meta.url);

With this

console.log(require('url').pathToFileURL(__filename).toString());

Installation

Install this package

npm install --save-dev babel-plugin-transform-import-meta

And configure it

{
  "plugins": [
    "babel-plugin-transform-import-meta"
  ]
}

Settings

ES6 modules

It's possible to use ES6 modules for the output. Useful to delegate module transformation to other plugins.

{
  "plugins": [
    ["babel-plugin-transform-import-meta", { "module": "ES6" }]
  ]
}

Credits

Based on a previous project "babel-plugin-import-meta" by The Polymer Authors

Keywords

FAQs

Package last updated on 04 Aug 2023

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