docker-parse-image

3.0.1 • Public • Published

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

/docker-parse-image/

    Package Sidebar

    Install

    npm i docker-parse-image

    Weekly Downloads

    1,796

    Version

    3.0.1

    License

    MIT

    Last publish

    Collaborators

    • mafintosh