NPM Download Methods Guide
A comprehensive guide covering various methods to download and integrate NES products, including direct downloads, NPM, and Yarn package manager configurations.
Depending on a product's technology stack, there may be several methods your teams can use to obtain said product. This document will cover both general and specific cases, and will evolve over time as new methods and technologies become available.
IMPORTANT REMINDER: If you're downloading a browser based NES product, you must take the appropriate steps to compile / bundle / protect the source code in your derivative works. Please review your Subscription Agreements or contact support@herodevs.com.
Direct Download
Regardless of the technology stack or package managers, all of our products will be available via direct download. We support standard HTTP requests, whether from the browser and/or command line tools like cURL. Examples for each are below, but can also serve as a guide for whatever tool you prefer to use.
Browser Download
Follow these 3 easy steps:
- Obtain the direct download URL for the product from its documentation page
- Navigate to the direct download URL in your browser
- Enter the username / password combination of browser /
<NES_ACCESS_TOKEN>
in your browser's Basic Authentication prompt that appears - Download the source and integrate it into your product as necessary
Command Line Download
Follow these 3 easy steps:
- Obtain the direct download URL for the product from its documentation page
- Use your CLI tool to download the url, via one of the two Authorization header configurations:
- Bearer Tokens (preferred)
- Set the header to
Bearer <NES_ACCESS_TOKEN>
substituting your token as appropriate
- Set the header to
- Basic Authentication (fallback)
- If the Bearer Token option is not possible with your tools, use this method
- Set the header to
Basic <base64credentials>
where<base64credentials>
is the base64 encoded value of username manual and your Access Token as the password (manual:<NES_ACCESS_TOKEN>
) - An example of generating the base64 credentials on linux systems follows:
- Bearer Tokens (preferred)
- Run the command, extract the library, and integrate it into your product as necessary
Node Package Manager (NPM)
As NPM is the default package manager for Node.js and most of the JavaScript/Typescript world, products that fall into that category use this method by default. Please refer to the product documentation for more information.
Yarn Package Manager
While NPM is the official package manager we support, many of our customers have had success configuring their Yarn projects with NES support. Depending on your project and the version of Yarn, you may need to make adjustments accordingly.
Using Yarn 1.x
In classic Yarn (v1.x) the .npmrc is respected, but there still can be issues related to scoped npm registries. As such, we recommend following the advice in Joe Gornick's blog from 2019.
Create a .yarnrc file with the following:
NOTE: For Yarn 1.x, the recommended file is .yarnrc (no extension)
Using Yarn 2.x+
Yarn 2+ introduced a new format with more options. In addition to creating a .npmrc file, you should also create a .yarnrc.yml file with the following:
NOTE: For Yarn 2.x+, the recommended file is .yarnrc.yml (extension included)