@al-c/flatten-path
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

flatten-path

npm version

how to use

import { makeTree, flatten } from '@al-c/flatten-path';

const data = [
  `packages.json`,
  `readme.md`,
  `src/components/hold/a/a/a.js`,
  `src/components/hold/a/a/b.js`,
  `src/components/hold/b/a/b.js`,
  `src/components/kiss/a/b.js`,
  `src/components/kiss/b/a.js`,
  `src/components/a/b.js`,
  `src/another/components/a/b.js`,
  `utils/a/b.js`,
  `utils/b/b.js`,
];

console.log(flatten(data));

console.log(makeTree(data));

Readme

Keywords

none

Package Sidebar

Install

npm i @al-c/flatten-path

Weekly Downloads

0

Version

0.3.1

License

MIT

Unpacked Size

16 kB

Total Files

7

Last publish

Collaborators

  • cangzhang