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

autobarrel

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autobarrel

Simple tool for creating ["barrel" files](https://basarat.gitbook.io/typescript/main-1/barrel) in TypeScript

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
377
decreased by-49.6%
Maintainers
1
Weekly downloads
 
Created
Source

autobarrel

Simple tool for creating "barrel" files in TypeScript

Caveats:

  • Has not been tested on Windows
  • Only meant for TypeScript, as TS will check that there are no conflicting exports
  • Assumes you do not export default or have specific exports in the index. If you need this, exclude and re-export from another module
  • Does not actually check files for the presence of export in ts files
    • Possibly in future scope, PRs welcome. In the meantime use the paths / exclude / ignored options

CLI Usage:

autobarrel [--config path/to/autobarrel.json] [--watch]

autobarrel.json:

{
  /**
   * Relative glob patterns we want to process
   */
  paths: string[]
  /**
   * Relative glob patterns we want to ignore entirely
   */
  ignore?: string[]
  /**
   * Relative glob patterns of files / directories we want to avoid re-exporting
   */
  exclude?: string[]
}

Programmatic Usage:

import { autobarrel, resolveAutobarrelConfig } from "autobarrel"

//
await autobarrel(
  // Converts relative paths to absolute paths for consistency
  await resolveAutobarrelConfig({
    path: path.join(__dirname, "testing", "autobarrel.json"),
  })
)

License

MIT

FAQs

Package last updated on 30 Jan 2022

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