Nupital Pomp Mesmerises

    @depack/split

    1.0.0 • Public • Published

    @depack/split

    npm version

    @depack/split Splits The Package Name To Return The Name With Scope And Paths.

    yarn add -E @depack/split

    Table Of Contents

    API

    The package is available by importing its default function:

    import split from '@depack/split'

    split(
      name: string,
    ): { name: string, paths: string }

    Returns the name and paths for the given package string that can have a scope and the paths after the package name.

    /* alanode example/ */
    import split from '@depack/split'
    
    console.log(split('package-name'))
    console.log(split('package-name/src/index.js'))
    console.log(split('@scope/package-name'))
    console.log(split('@scope/package-name/src/index.js'))
    { name: 'package-name', paths: '' }
    { name: 'package-name', paths: 'src/index.js' }
    { name: '@scope/package-name', paths: '' }
    { name: '@scope/package-name', paths: 'src/index.js' }

    Copyright

    Art Deco © Art Deco for Depack 2019 Tech Nation Visa Tech Nation Visa Sucks

    Install

    npm i @depack/split

    DownloadsWeekly Downloads

    43

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.96 kB

    Total Files

    9

    Last publish

    Collaborators

    • zvr