Skip to content

Files

Latest commit

 

History

History

dev

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

<%= projectName %>

CI <% if (isProjectOnNpm) { -%> Version <% } -%> <% if (projectVersion && !isProjectOnNpm) { -%> Version <% } -%> <% if (projectPrerequisites) { -%> <% projectPrerequisites.map(({ name, value }) => { -%> <% }) -%> <% } -%> <% if (projectDocumentationUrl) { -%> Documentation <% } -%> <% if (isGithubRepos) { -%> Maintenance <% } -%> <% if (licenseName) { -%> License: <%= licenseName %> <% } -%> <% if (authorTwitterUsername) { -%> Twitter: <%= authorTwitterUsername %> <% } -%>

<% if (projectDescription) { -%>

<%= projectDescription %> <% } -%>

Install

npm install --save <%= projectName %>

patha is tiny and treeshakable.

Usage

Automatic (depends on your build system)

import * as patha from "patha"

Node

import * as patha from "patha/dist/index.node.mjs"

Node CJS

const patha = require("patha/dist/index.node.cjs")

Browser

import * as patha from "patha/dist/index.browser.mjs"

Browser Legacy

import * as patha from "patha/dist/index.browser.legacy.js"

Deno

import * as patha from "patha/dist/index.deno.mjs"

API

patha is a drop-replacement for path, which is explained in the Nodejs documentation.

import {
  basename,
  delimiter,
  dirname,
  extname,
  format,
  isAbsolute,
  join,
  normalize,
  parse,
  posix,
  relative,
  resolve,
  sep,
  toNamespacedPath,
  win32,
} from "patha"

Additionally, patha supports the following functions:

🤝 Contributing

You can sponsor my work here:

https://github.com/sponsors/aminya

Pull requests, issues and feature requests are welcome. See the Contributing guide.