npm bin fields - PoC

node v10.24.1
version: 1.0.0
endpointsharetweet
const { dirname, resolve, relative } = require('path') const bin = {"doraemon-storybook:main": "bin/doraemon_storybook-main"}; const target = '/opt/bin'; const path = '/yes/no/'; // norm({name: 'a:b/c.d', bin: 'one:two.three/four'}); for (const [key, val] of Object.entries(bin)) { const to = resolve(target, key) const absFrom = resolve(path, val) const from = relative(dirname(to), absFrom) console.dir({path, from, to, absFrom}) }
Loading…

no comments

    sign in to comment