@jace1995/full-paths
v1.0.2
Published
Relative path converter to absolute
Downloads
2
Maintainers
Readme
@jace1995/full-paths
Relative path converter to absolute
Install
npm i -S @jace1995/full-paths
Usage
import { fullPaths, fullPathsFromRoot, fullPathsFromFolder } from '@jace1995/full-paths';
import * as path from 'path';
const relativePaths: Record<string, string> = {
package: 'package.json',
tsconfig: 'tsconfig.json',
};
const _fullPaths = fullPaths(relativePaths);
const _fullPathsFromRoot = fullPathsFromRoot('test', relativePaths);
const _fullPathsFromFolder = fullPathsFromFolder(
path.join(process.cwd(), 'test'),
relativePaths
);
// { package: '{APP_FOLDER}/package.json', tsconfig: '{APP_FOLDER}/tsconfig.json' }
console.log(_fullPaths);
// { package: '{APP_FOLDER}/test/package.json', tsconfig: '{APP_FOLDER}/test/tsconfig.json' }
console.log(_fullPathsFromRoot);
// { package: '{APP_FOLDER}/test/package.json', tsconfig: '{APP_FOLDER}/test/tsconfig.json' }
console.log(_fullPathsFromFolder);