Compare commits

...

7 Commits

Author SHA1 Message Date
a074b82c47 Fixed md output containing object as repo
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-13 13:47:05 +01:00
48008e5ebe Version bump 2021-02-13 13:45:33 +01:00
fb15002582 Merge branch 'main' of git.odit.services:odit/license-exporter into main
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-13 13:44:56 +01:00
0992179dfd Fixed bug for empty repo info 2021-02-13 13:44:52 +01:00
2eeacf1219 Fixed table in readme
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-25 10:54:44 +00:00
350497cfdb 🚀 Version bump to 0.0.9
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-09 13:39:04 +01:00
29d8b9ccb8 also export dependency versions 2021-01-09 13:38:29 +01:00
3 changed files with 13 additions and 12 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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",