node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Codecov NodeJS Uploader

NPM version Build Status Build Status Dependency Status Dev Dependency Status support for node.js.


Add the latest version of codecov to your package.json:

npm install codecov --save-dev


yarn add codecov --dev


This script ( bin/codecov ) detect your CI provider and all coverage reports and uploads them to Codecov.

Once your app is instrumented for coverage, and building, simply call ./node_modules/.bin/codecov.

This library currently supports the following CI companies: Travis CI, Travis, Appveyor, CircleCI, Codeship, Drone, Jenkins, Shippable, Semaphore, Wercker, Snap CI, Buildkite.

Upload repo tokens

Repo tokens are not required for public repos tested on Travis-Org, CircleCI or AppVeyor.

Repo tokens are necessary to distinguish your repository from others. You can find your repo token on your repository page at Codecov. Set this unique uuid to CODECOV_TOKEN in your environment variables.

export CODECOV_TOKEN=":uuid-repo-token"
# or
./node_modules/.bin/codecov --token=:token


With Mocha:

istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec

With Jasmine:

istanbul cover jasmine-node --captureExceptions spec/

With Tape:

istanbul cover test.js

With NYC

nyc npm test
nyc report --reporter=text-lcov > coverage.lcov

Change Log

  • v2.0.0 No longer supports node v0.10 because of the execSync.
  • v2.0.1 Publish as latest instead of next.
  • v2.0.2 Display correct version number in console.
  • v2.1.0 Flags supported
  • v2.2.0 Support for Jenkins Blue Ocean. Clean reports after upload. Fix for Gitlab.
  • v2.3.0 Added support for Windows. Updated dependencies.
  • v3.0.0 No longer supports node v0.12 because of new version of request