Skip to content

Instantly share code, notes, and snippets.

@kriswill
Created October 9, 2017 19:24
Show Gist options
  • Save kriswill/27d778647042e1444802fc055dcae166 to your computer and use it in GitHub Desktop.
Save kriswill/27d778647042e1444802fc055dcae166 to your computer and use it in GitHub Desktop.
Parse alpine apk package versions into a JSON blob
node -p "require('child_process').exec('apk info --verbose', (err, out) => { packages = {}; out.split('\n').filter(line => line.length).forEach(line => { const parts = line.split('-'); packages[parts[0]] = line.replace(parts[0]+'-', ''); }); console.log(JSON.stringify(packages, null, 2)); process.exit(0)}); '';"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment