path-union

2.0.5 • Public • Published

path-union

Create a union between two paths

js-standard-style npm version

Install

npm install path-union

Usage

Given two paths create a new union path.

import {union} from 'path-union'
 
const src = '/Users/davidchase/Desktop/github/path-union/fixtures/packages'
const dest = '/Users/davidchase/Desktop/github/path-union/dist'
 
union(dest, src) // => '/Users/davidchase/Desktop/github/path-union/dist/fixtures/packages'

also as a bonus you can do functional composition right to left 🔥

import {union, compose} from 'path-union'
import {dirname} from 'path'
 
const src = '/Users/davidchase/Desktop/github/path-union/fixtures/packages'
const dest = '/Users/davidchase/Desktop/github/path-union/dist'
 
 
compose(dirname, union)(dest, src) // => '/Users/davidchase/Desktop/github/path-union/dist/fixtures'

API

union :: String => String => String

Todo

  • add rollup + buble

Readme

Keywords

Package Sidebar

Install

npm i path-union

Weekly Downloads

2

Version

2.0.5

License

MIT

Last publish

Collaborators

  • davidchase