path-breadcrumb

1.0.1 • Public • Published

path-breadcrumb

パスを分解して階段状に積み上げる

install

$ npm install path-breadcrumb

Usage

const pathcrumb = require('path-breadcrumb');

let test1 = '/aaa/bbb/ccc/ddd';
console.log('[test1]', pathcrumb(test1));
//-> [ '/aaa', '/aaa/bbb', '/aaa/bbb/ccc', '/aaa/bbb/ccc/ddd' ]


let test2 = 'eee/fff/ggg';
console.log('[test2]', pathcrumb(test2));
//-> [ 'eee', 'eee/fff', 'eee/fff/ggg' ]


let test3 = '/index.html';
console.log('[test3]', pathcrumb(test3));
//-> []

Readme

Keywords

Package Sidebar

Install

npm i path-breadcrumb

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kesuiket