next-path-parse
Parse path for next.
installation
npm install -S @feizheng/next-path-parse
usage
import '@feizheng/next-path-parse';
const res = nx.pathParse('/User/feizheng/github/test/build/static/css/8.f96cc274.chunk.css', {
cwd: '/User/feizheng/github/test/',
context:'build'
});
/*
{
cwd: '/User/feizheng/github/test/',
context: 'build',
root: '/',
dir: '/User/feizheng/github/test/build/static/css',
base: '8.f96cc274.chunk.css',
ext: '.css',
name: '8.f96cc274.chunk',
full: '/User/feizheng/github/test/build/static/css/8.f96cc274.chunk.css',
parent: 'build/static/css/8.f96cc274.chunk.css',
relative: 'static/css/8.f96cc274.chunk.css'
}
*/
resources
license
Code released under the MIT license.