🚀
Empathize
  • Introduction
  • Installation
  • API
    • Paths API
      • Directories
      • Paths
    • Filesystem API
      • Filesystem
    • Windows API
      • Windows
    • OS API
      • Process
      • Tray
      • IPC
      • Notification
      • Archive
      • Package
    • Network API
      • fetch
      • Domain
      • Downloader
    • Async API
      • promisify
    • Meta classes
      • Cache
      • Configs
      • Debug
  • Building application
Powered by GitBook
On this page
  • path.separator
  • path.delimiter
  • path.join(...args)
  • path.normalize(path)
  • path.relative(path, base)
  • path.addSlashes(str)
  1. API
  2. Paths API

Paths

path.separator

System
Symbol

Linux

/

path.delimiter

System
Symbol

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)}"`);
PreviousDirectoriesNextFilesystem API

Last updated 3 years ago