Paths

path.separator

SystemSymbol

Linux

/

path.delimiter

SystemSymbol

Linux

:

path.join(...args)

import { path } from '@empathize/framework';

// 'my_folder/my_file.txt'
console.log(path.join('my_folder', 'my_file.txt'));

path.normalize(path)

import { path } from '@empathize/framework';

// 'my_folder/my_file.txt'
console.log(path.normalize('folder/../my_folder//my_file.txt'));

path.relative(path, base)

import { path } from '@empathize/framework';

// '../file.txt'
console.log(path.relative('folder_1/file.txt', 'folder_1/folder_2'));

path.addSlashes(str)

import { path, Process } from '@empathize/framework';

// 'my_folder/my_file.txt'
const file = path.join('my_folder', 'my_file.txt');

// Run rm -rf "path to file" command
Process.run(`rm -rf "${path.addSlashes(file)}"`);

Last updated