Commercial Licenses for NPM Packages

When creating new projects, the standard package.json file usually contains a MIT License or similar – but for those of us (Evil Capitalists!) who want to take simple steps to protect our rights and ownership of the code, it's not immediately obvious how best to add a suitable license.

In practice it's extremely simple, add the following to your package.json file

"license": "UNLICENSED"

Then in the same root as your package.json create a file named LICENSE and inside it add the following text;

(c) Copyright YYYY Your legal entity. All rights reserved.

For example;

(c) Copyright 2016 Bonbon Group Ltd. All rights reserved.

This should be enough to satisfy NPM commands if you had a missing or incorrect license, and this does replace the older "license": "LicenseRef-LICENSE" of earlier NPM versions.