Socket
Socket
Sign inDemoInstall

babel-plugin-transform-glob-import

Package Overview
Dependencies
7
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-glob-import

Import multiple files at once with globs


Version published
Maintainers
1
Created

Readme

Source

babel-plugin-transform-glob-import

Import multiple files at once with globs

Example

Importing both dir/a.js and dir/b.js at once:

import vars from './dir/*.js';

console.log(vars.a, vars.b);

You can also import deeply nested globs. The result is a nested object for each directory:

// import dir/a.js and dir/b/c.js
import vars from './dir/**/*.js';

console.log(vars.a, vars.b.c);

Importing only some files with destructuring also works:

// imports only dir/a.js, and dir/b.js
import {a, b} from './dir/*.js';

License

MIT

FAQs

Package last updated on 14 Dec 2017

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc