Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@safelytyped/node-pathapi

SafelyTyped22BSD-3-Clause1.1.1TypeScript support: included

The cross-platform bits of NodeJS's path module, as a protocol, for TypeScript.

readme

Welcome To @safelytyped/node-pathapi!

Introduction

@safelytyped/node-pathapi is a protocol library.

It provides a Typescript interface for the NodeJS path module methods that work on both POSIX and Windows (ie, the interface that describes both path.posix and path.win32).

Use it to help you test libraries that take path as a dependency. See the Filepath safe type for a working example.

Quick Start

# run this from your Terminal
npm install @safelytyped/node-pathapi
// add this import to your Typescript code
import { PathApi } from "@safelytyped/node-pathapi"

VS Code users: once you've added a single import anywhere in your project, you'll then be able to auto-import anything else that this library exports.

Documentation

Looking for more detailed documentation? You'll find it under the docs folder.

Plus:

changelog

CHANGELOG

Introduction

This CHANGELOG tells you:

  • when a release was made
  • what is in each release

It also tells you what changes have been completed, and will be included in the next tagged release.

For each release, changes are grouped under these headings:

  • Backwards-Compatibility Breaks: a list of any backwards-compatibility breaks
  • New: a list of new features. If the feature came from a contributor via a PR, make sure you link to the PR and give them a mention here.
  • Fixes: a list of bugs that have been fixed. If there's an issue for the bug, make sure you link to the GitHub issue here.
  • Dependencies: a list of dependencies that have been added / updated / removed.
  • Tools: a list of bundled tools that have been added / updated / removed.

develop branch

The following changes have been completed, and will be included in the next tagged release.

v1.1.1

Released Saturday, 2nd March 2024.

Fixes

  • Added missing package.json entries for JS entry points (doh!)

v1.1.0

Released Saturday, 2nd March 2024.

Fixes

  • Added simultaneous support for CommonJS and ESM runtime environments

Dependencies

  • Upgraded to Typescript v5.2
  • Switched tslint for eslint

v1.0.1

Released Wednesday, 26th May 2020.

Dependencies

  • Bumped all dependencies to their latest version

v1.0.0

Released Tuesday, 23rd June 2020.

New

  • PathApi
    • added .basename()
    • added .delimiter
    • added .dirname()
    • added .extname()
    • added .format()
    • added .isAbsolute()
    • added .join()
    • added .normalize()
    • added .parse()
    • added .relative()
    • added .resolve()
    • added .toNamespacedPath()
    • added .sep