New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-logger-namespace

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-logger-namespace

Babel plugin that generates the namespace for creating a logger based on the path of the module

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
98
decreased by-35.1%
Maintainers
0
Weekly downloads
 
Created
Source

babel-plugin-logger-namespace

Babel plugin that generates the namespace for creating a logger based on the path of the module.

E.g. for file src/test/module.js

import debug from 'debug'

const log = debug(NAMESPACE)

And outputs code compatible with CommonJS

const log = debug('src:test:module')

Installation

npm install --save-dev babel-plugin-logger-namespace

After the plugin is installed, configure it in babel config file

  "plugins": [
    "babel-plugin-logger-namespace"
  ]

Plugin Options

  • placeholder?: The placeholder that will be replaced with the module name. Default is NAMESPACE.
  • stripPrefix?: Remove specified prefix from the resulting namespace. You can set multiple of them by separating each item with a |. e.g. foo:|bar: will remove both foo and bar from the prefix.
  • prefix?: Add specified prefix to the resulting namespace
  • stripSubfix?: Remove specified subfix from the resulting namespace. Same as stripPrefix, it supports multiple subfixes that separated by |.

Keywords

FAQs

Package last updated on 13 Dec 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