Skip to content

bcombinator/path-union

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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