Choosing a License

Choosing an Open-Source License

Public code without a license is not open source: copyright reserves every right to the author. A license grants those rights on conditions, and the conditions are what you choose between:

Common open-source licenses, from most to least permissive
License Kind Main condition Used by
MIT Permissive Keep the notice Express 24,430 , Node.js 2,131
Apache-2.0 Permissive, patent grant Keep notices, state changes Kubernetes 5,150
MPL-2.0 File-level copyleft Share changed files Firefox 555
GPL-3.0 Strong copyleft Share the whole derived work Bash
AGPL-3.0 Network copyleft Share it even when served over a network Grafana 2,264

BookNest takes MIT, the most common license on GitHub 29 : short, permissive, and understood by every company's legal team. GitHub's API serves the canonical texts, so the file never has typos:

Adding the MIT License and declaring it in package.jsonJSON
gh api licenses/mit --jq .body \
  | sed -e 's/\[year\]/2026/' -e 's/\[fullname\]/The BookNest authors/' > LICENSE
npm pkg set license=MIT
npm install --package-lock-only --silent
git add LICENSE package.json package-lock.json
git commit -q -m "License BookNest under the MIT License"
git push -q
gh repo view --json licenseInfo --jq .licenseInfo
Output
{"key":"mit","name":"MIT License","nickname":""}

The file starts Copyright (c) 2026 The BookNest authors. GitHub recognized it (with the open-source Licensee library), so the license shows in the sidebar and search filters; package.json tells npm 2,036 the same. "The BookNest authors" is a common convention for projects with many contributors. GitHub's choosealicense.com (https://choosealicense.com 42,819 ) helps you choose.