2.0.0 • Published 4 years ago

convert-typing-name v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Convert typing name Travis CI Build Status

Convert the name of a Typescript typings package to it's npm package counterpart.

NPM Badge

Install

npm install convert-typing-name

Usage

const typingName = require("convert-typing-name");

typingName("a");
//=> "@types/a"

typingName("@a/b");
//=> "@types/a__b"

typingName.from("@types/a");
//=> "a"

typingName.from("@types/a__b");
//=> "@a/b"

API

typingName(name)

Convert the name of a npm package to it's Typescript typings package counterpart.

name

Type: string

The npm package name to convert.

typingName.from(name)

Convert the name of a Typescript typings package to it's npm package counterpart.

name

Type: string

The typings package name to convert.

Similar

Migrating from 1.x

  • A minimum version of Node.js 10 is required.
  • typingName.toTyping is now typingName
  • typingName.fromTyping is now typingName.from