antipathy

Sane Node.js filesystem operations for TypeScript 📁

Usage no npm install needed!

<script type="module">
  import antipathy from 'https://cdn.skypack.dev/antipathy';
</script>

README

antipathy

Build Status Coverage Status JavaScript Style Guide

Welcome to sane Node.js filesystem paths, inspired by Python's pathlib

Example

const p = new Path("/etc/")
p.push("apt.d/sources.list")
p.pop()
p.getAbsolute()       // => /etc/apt.d
p.getRelative("/etc") // => apt.d

See src/main.spec.ts for more examples.

Features

  • 0 dependencies (can even run on the browser!)
  • Written in TypeScript with complete type coverage
  • Advanced path resolution algorithms for maximum safety