nuget-push

push nuget packages to feed directly, no need for nuget cli.

Usage no npm install needed!

<script type="module">
  import nugetPush from 'https://cdn.skypack.dev/nuget-push';
</script>

README

nuget-push

Natively push nuget packages in nodejs.

This package does NOT need nuget cli, no dependency outside of node!

This package has been created for dev-ops purposes on dotnet core projects.

Usecase

You can run dotnet pack commands to create your nuget packages, and nuget-push to push them to the feed. This way the nuget commandline tool is not needed. usefull for cross-os development

Usage

var push = require('nuget-push');

push('MyPackage.1.0.0.nuPackage','nuget.org','MyApiKey',function(error, response){
    //errors from: https://www.npmjs.com/package/form-data.
    //for response info: https://nodejs.org/api/http.html#http_http_request_options_callback
    if(error)
        throw error;
    if(response.statusCode === 201){
        //Success
    } else {
        console.warn(response.statusCode + ":" + response.statusMessage);
        //eg: 409: Package already exists;
    }
});