Skip to content

Transforms plugin names into package names, as seen at e.g. eslint, stricter, and others.

License

Notifications You must be signed in to change notification settings

obweger/plugin-name-to-package-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin-name-to-package-name

Transforms plugin names into package names, as seen at e.g. eslint, stricter, and others.

From eslint's Working with Plugins:

Each plugin is an npm module with a name in the format of eslint-plugin-<plugin-name>, such as eslint-plugin-jquery. You can also use scoped packages in the format of @<scope>/eslint-plugin-<plugin-name> such as @jquery/eslint-plugin-jquery or even @<scope>/eslint-plugin such as @jquery/eslint-plugin.

Installation

$ npm install plugin-name-to-package-name
const { transform } = require('plugin-name-to-package-name');

console.log(transform('@foo/bar', 'eslint-plugin')); // @foo/eslint-plugin-bar

Usage

transform takes two parameters; the pluginName, and the pluginPrefix. In the above example, pluginName is '@foo/bar' and pluginPrefix is 'eslint-plugin'.

Examples

pluginName pluginPrefix Result
@foo eslint-plugin @foo/eslint-plugin
bar stricter-plugin stricter-plugin-bar
@foo/bar modster-plugin @foo/modster-plugin-bar

Contributions

Yes please!

About

Transforms plugin names into package names, as seen at e.g. eslint, stricter, and others.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published