3.0.1 • Published 10 years ago

docker-parse-image v3.0.1

Weekly downloads
1,461
License
MIT
Repository
github
Last release
10 years ago

docker-parse-image

Parse docker image urls

npm install docker-parse-image

build status

Usage

var parse = require('docker-parse-image')

console.log(parse('mafintosh/test'))
// --> {namespace:'mafintosh', repository:'test', tag:null}

console.log(parse('ubuntu'))
// --> {namespace:null, repository:'ubuntu', tag:null}

console.log(parse('mafintosh/test:14.04'))
// --> {namespace:'mafintosh', repository:'test', tag:'14.04'}

console.log(parse('ubuntu:14.04'))
// --> {namespace:null, repository:'ubuntu', tag:'14.04'}

console.log(parse('registry.com/ubuntu:14.04'))
// --> {registry:'registry.com', namespace:null, tag:'14.04'}

License

MIT