Create a union between two paths
npm install path-union
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'
- add rollup + buble