Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.