import RegClient = require ( 'anonymous-npm-registry-client' ) ; export async function add ( pkg , version , distTag ) { const client = new RegClient ( ) ; await new Promise ( ( resolve , reject ) => client . distTags . fetch ( 'http://localhost:4873' , { package : pkg } , ( err ) => err ? reject ( err ) : resolve ( ) ) ) ; await new Promise ( ( resolve , reject ) => client . distTags . rm ( 'http://localhost:4873' , { package : pkg , distTag } , ( err ) => err ? reject ( err ) : resolve ( ) ) ) ; await new Promise ( ( resolve , reject ) => client . distTags . add ( 'http://localhost:4873' , { package : pkg , version , distTag } , ( err ) => err ? reject ( err ) : resolve ( ) ) ) ; }