Compare commits
7 Commits
5f2f202f49
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a074b82c47 | |||
| 48008e5ebe | |||
| fb15002582 | |||
| 0992179dfd | |||
| 2eeacf1219 | |||
| 350497cfdb | |||
| 29d8b9ccb8 |
18
README.md
18
README.md
@@ -24,12 +24,12 @@ Export all dependencies to markdown: `licenseexporter --md --recursive`
|
||||
|
||||
## Options
|
||||
Arg | Description | Type | Default
|
||||
- | - | - | -
|
||||
-j, --json | Exports the license information into ./licenses.json as json. | flag/[boolean] | N/A
|
||||
-p, --pretty | Prettify the json output.|flag/[boolean] | N/A
|
||||
-m, --markdown | Exports the license information into ./licenses.md as markdown. | flag/[boolean] | N/A
|
||||
-r, --recursive | Include all of the dependencies' subdependencies. | flag/[boolean] | N/A
|
||||
-o, --output | Output folder for the exports. | [string] | Current folder
|
||||
-i, --input | Path to the input folder containing your package.json and node_modules | [string] | Current folder
|
||||
-h, --help | Show help | flag/[boolean] | N/A
|
||||
-v, --version | Show version number | flag/[boolean] | N/A
|
||||
| - | - | - | -
|
||||
\-j, --json | Exports the license information into ./licenses.json as json. | flag/[boolean] | N/A
|
||||
\-p, --pretty | Prettify the json output.|flag/[boolean] | N/A
|
||||
\-m, --markdown | Exports the license information into ./licenses.md as markdown. | flag/[boolean] | N/A
|
||||
\-r, --recursive | Include all of the dependencies' subdependencies. | flag/[boolean] | N/A
|
||||
\-o, --output | Output folder for the exports. | [string] | Current folder
|
||||
\-i, --input | Path to the input folder containing your package.json and node_modules | [string] | Current folder
|
||||
\-h, --help | Show help | flag/[boolean] | N/A
|
||||
\-v, --version | Show version number | flag/[boolean] | N/A
|
||||
@@ -70,10 +70,11 @@ function getDependencyLicenseInfo(all_dependencies, recursive) {
|
||||
}
|
||||
const info = {
|
||||
author: packageinfo.author,
|
||||
repo: packageinfo.repository || packageinfo.repository.url,
|
||||
repo: packageinfo.repository || packageinfo.repository?.url,
|
||||
description: packageinfo.description,
|
||||
name: packageinfo.name,
|
||||
license: packageinfo.license,
|
||||
version: packageinfo.version,
|
||||
licensetext
|
||||
};
|
||||
all.push(info);
|
||||
@@ -98,7 +99,7 @@ if (args.markdown) {
|
||||
all.forEach((p) => {
|
||||
fs.appendFileSync(
|
||||
(args.output+'/licenses.md'),
|
||||
`# ${p.name}\n**Author**: ${p.author}\n**Repo**: ${p.repo}\n**License**: ${p.license}\n**Description**: ${p.description}\n## License Text\n${p.licensetext} \n\n`
|
||||
`# ${p.name}\n**Author**: ${p.author}\n**Repo**: ${p.repo?.url || p.repo}\n**License**: ${p.license}\n**Description**: ${p.description}\n## License Text\n${p.licensetext} \n\n`
|
||||
);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odit/license-exporter",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.10",
|
||||
"description": "A simple license crawler for crediting open source work",
|
||||
"keywords": [
|
||||
"license",
|
||||
|
||||
Reference in New Issue
Block a user