{"_id":"@audc/license-downloader","_rev":"1-aa970b1136719de95c74cef36cda7240","name":"@audc/license-downloader","dist-tags":{"latest":"1.0.13"},"versions":{"1.0.13":{"name":"@audc/license-downloader","version":"1.0.13","keywords":["license","cli","download"],"author":{"name":"BePo65"},"license":"MIT","_id":"@audc/license-downloader@1.0.13","homepage":"https://github.com/audiocodes/license-downloader#readme","bugs":{"url":"https://github.com/BePo65/license-downloader/issues"},"bin":{"license-downloader":"index.js"},"dist":{"shasum":"21a52045cf06ed06b160bc4f1d2c74a1bfd7a7ee","tarball":"https://registry.npmjs.org/@audc/license-downloader/-/license-downloader-1.0.13.tgz","fileCount":9,"integrity":"sha512-rDY0DuoKEIhxPSX1ZjF+NBdafyk9Bty29mUm+axm2anIBBJG8JyXKqaOp2GQ7+Fu9efx3g6vR4+KrE/pExAs6g==","signatures":[{"sig":"MEUCIQDTntXX2c1DZfEyjTmcdJQiKGqU2Ce1ZPheZsuyAR+jtQIgNQItxA+JomXP8ztWyLOoUzO17W4dE/gb7JgpSo2D6oM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28862},"main":"index.js","type":"module","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"engines":{"node":">=18"},"gitHead":"11f184afff52625bc06c8306b17b4b6c30c0df11","scripts":{"lint":"npx eslint index.js lib/**/*.js test/**/*.js **/*.json","test":"npx mocha -R spec","release":"commit-and-tag-version -i CHANGELOG.md --same-file","lint-commits":"commitlint --from d6a731d70b4f2 --to HEAD --verbose","init-changelog":"commit-and-tag-version -i CHANGELOG.md --same-file --prerelease pre --first-release"},"_npmUser":{"name":"orgads","email":"orgads@gmail.com"},"repository":{"url":"git+https://github.com/audiocodes/license-downloader.git","type":"git"},"_npmVersion":"10.8.1","description":"Download the license files of the dependencies of a project","directories":{},"_nodeVersion":"20.14.0","dependencies":{"rc":"^1.2.8","got":"^14.4.1","debug":"^4.3.5","jsonfile":"^6.1.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^5.1.1","temp":"^0.9.4","husky":"^9.0.11","mocha":"^10.4.0","eslint":"^9.5.0","@commitlint/cli":"^19.3.0","eslint-plugin-n":"^17.9.0","eslint-plugin-json":"^4.0.0","eslint-plugin-jsdoc":"^48.2.12","eslint-plugin-mocha":"^10.4.3","commit-and-tag-version":"^12.4.1","eslint-plugin-security":"^3.0.1","eslint-plugin-chai-expect":"^3.1.0","@commitlint/config-angular":"^19.3.0","eslint-plugin-prefer-arrow":"^1.2.3","eslint-plugin-security-node":"^1.1.4"},"commit-and-tag-version":{"bumpFiles":[{"type":"json","filename":"package.json"},{"type":"json","filename":"package-lock.json"},{"updater":"tools/npm-scripts/readme-updater.cjs","filename":"README.md"}],"packageFiles":[{"type":"json","filename":"package.json"}]},"_npmOperationalInternal":{"tmp":"tmp/license-downloader_1.0.13_1719471836563_0.9477882105014828","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-06-27T07:03:56.479Z","modified":"2025-01-19T20:18:59.513Z","1.0.13":"2024-06-27T07:03:56.739Z"},"bugs":{"url":"https://github.com/BePo65/license-downloader/issues"},"author":{"name":"BePo65"},"license":"MIT","homepage":"https://github.com/audiocodes/license-downloader#readme","keywords":["license","cli","download"],"repository":{"url":"git+https://github.com/audiocodes/license-downloader.git","type":"git"},"description":"Download the license files of the dependencies of a project","maintainers":[{"email":"orgads@gmail.com","name":"orgads"}],"readme":"# license-downloader - an add-on to license-report tool\r\n![Version](https://img.shields.io/badge/version-1.0.13-blue.svg?cacheSeconds=2592000)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](#)\r\n\r\n> Download the license files of the dependencies of a project based on the json report from the package 'license-report'.\r\n\r\n## Install\r\n\r\n```sh\r\nnpm install license-downloader\r\n```\r\n\r\n## Usage\r\n\r\n'license-downloader' uses the github REST API to find the location of the license files of the project (dev-) dependencies. The license file location does not depend on the package version. Details about how the license file is detected can be found in [licensee/licensee > What we look at](https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md) and [licensee/licensee > README](https://github.com/licensee/licensee/tree/master/docs).\r\n\r\nOptionally it downloads these files to a given directory.\r\n\r\n### Usage with downloading the license files:\r\n```sh\r\ncd your/project/\r\nnpx license-report > ./license-report.json\r\nnpx license-downloader --source ./license-report.json --licDir ./license-files --download\r\n```\r\n\r\nA copy of the 'license-report.json' file with properties 'licenseFileLink' added is saved to the './license-files' directory (defined in option `--licDir`). The downloaded licenses are save in a subdirectory named 'licenses' in the directory defined in `--licDir`.\r\n\r\nIf option `--licDir` is missing, the modified 'license-report.json' file and the 'licenses' subdirectory are written to the path of the source file.\r\n\r\n### Usage without downloading the license files:\r\n```sh\r\ncd your/project/\r\nnpx license-report > ./license-report.json\r\nnpx license-downloader --source ./license-report.json\r\n```\r\n\r\nThe copy of the 'license-report.json' file with properties 'licenseFileLink' added is saved to the directory of the source file.\r\n\r\n## Authorization in GitHub\r\n\r\nLicense-downloader uses the github api to collect information about the license file of a project. If the rate limit for anonymous access to this api is exceeded (60 accesses per hour) you will get warnings like this:\r\n```\r\nkessler/node-tableify: License query failed. Rate limit of 60 requests per hour exceeded. please wait 1534 seconds before trying again.\r\ncaolan/async: License query failed. Rate limit of 60 requests per hour exceeded. please wait 1534 seconds before trying again.\r\n```\r\n\r\nTo avoid this problem you can use a github personal access token to use the higher limits of your personal github plan.\r\n\r\nThere are 2 possibilities:\r\n\r\n**use a file (recommended)**\r\n\r\nwrite the github token, generated in your github developer settings, to a file.\r\n\r\nThe full path to this file is written to an environment variable and the name of this environment variable is set in the config parameter 'githubToken.tokenFileEnvVar':\r\n```sh\r\nexport GITHUB_TOKEN_FILE=/run/secrets/github_pat.txt\r\ncd your/project/\r\nnpx license-report > ./license-report.json\r\nnpx license-downloader --source ./license-report.json --licDir ./license-files --githubToken.tokenFileEnvVar GITHUB_TOKEN_FILE --download\r\n```\r\nThis is the most secure variant, as access rights can be and should be set for this file to prevent unauthorized access.\r\n\r\n**use an environment variable**\r\n\r\nwrite the github token, generated in your github developer settings, to an environment variable and use the name of this environment variable in the config parameter 'githubToken.tokenEnvVar':\r\n```sh\r\nexport GITHUB_TOKEN=yourgithubtoken\r\ncd your/project/\r\nnpx license-report > ./license-report.json\r\nnpx license-downloader --source ./license-report.json --licDir ./license-files --githubToken.tokenEnvVar GITHUB_TOKEN --download\r\n```\r\n\r\n## Show debug log\r\n\r\nUse in linux shell\r\n```sh\r\nexport DEBUG=license-downloader\r\n```\r\nor in windows command line\r\n```sh\r\nSET DEBUG=license-downloader\r\n```\r\n\r\n## Development\r\n\r\nThis repo uses standard-changelog to create the CHANGELOG. To ensure that the commit messages follow the standard-changelog rules, husky is used for git hooks.\r\n\r\nTo initialize the git hooks after checking out the repo, run `npx husky install`.\r\n\r\nAllowed types for commit messages are:\r\n+ build\r\n+ ci\r\n+ docs\r\n+ feat\r\n+ fix\r\n+ perf\r\n+ refactor\r\n+ release\r\n+ revert\r\n+ style\r\n+ test\r\n\r\nAllowed scopes are:\r\n+ app\r\n+ hacks\r\n+ tools\r\n","readmeFilename":"README.md"}