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

@chatterbug/babel-plugin-directory-named

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chatterbug/babel-plugin-directory-named

Babel plugin directory named modules

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
3
Weekly downloads
 
Created
Source

babel-plugin-directory-named

When you import from a folder it resolves to the index.js file in that folder.

import { magic } from './src/magic' // imports ./src/magic/index.js

This plugin allows you to name the entry file the same as the folder.

import { magic } from './src/magic' // imports ./src/magic/magic.js

Nice! Now you don't need to have a bajillion index.js file scattered around your project.

Quick start

Install the plugin first:

npm install --save-dev babel-plugin-directory-named
{
  "plugins": [
    [
      "babel-plugin-directory-named",
      {
        "rootDir": "./src"
        "honorIndex": true | false // (default: false)
      }
    ]
  ]
}

Keywords

FAQs

Package last updated on 27 Nov 2019

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