2.4.0 • Published 3 years ago

elm-license-checker v2.4.0

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
3 years ago

Elm License Checker

NPM Pursuit test Join the chat at https://gitter.im/elm-license-checker/community Sponsor

Treats the licenses of the dependent packages.

This is inspired by NPM License Checker.

CLI Interface

You can show the package information with the selected fields.

> elm-license-checker --customPath format.json
├─ elm/json@1.1.3
│  ├─ name: elm/json
│  ├─ version: 1.1.3
│  ├─ summary: Encode and decode JSON values
│  ├─ license: BSD-3-Clause
│  └─ licenseFile: C:\Users\kazuki\AppData\Roaming\elm\0.19.1\packages\elm\json\1.1.3\LICENSE
├─ elm/time@1.0.0
│  ├─ name: elm/time
│  ├─ version: 1.0.0
│  ├─ summary: Work with POSIX times, time zones, years, months, days, hours, seconds, etc.
│  ├─ license: BSD-3-Clause
│  └─ licenseFile: C:\Users\kazuki\AppData\Roaming\elm\0.19.1\packages\elm\time\1.0.0\LICENSE
:

See the section “Compatibility with NPM License Checker” for options.

Custom Format

Fields that a format file contains are outputted. Values of fields that licenses do not have are given as ones of fields in a format file. Please also refer a document of the NPM License Checker.

There are an example file in test-asset/format.json.

Library Interface

The following is how to use this as a module.

The JavaScript interface is compatible with NPM License Checker, but is actually a subset.

See the section “Compatibility with NPM License Checker”.

const elc = require('elm-license-checker');

elc.init(
  { start: '/path/to/elm-application' },
  function (err, packages) {
    if (err) {
      // handle the error
    } else {
      // use the packages
    }
  }
);

The PureScript interface is also available.

import Prelude
import Effect (Effect)
import ElmLicenseChecker (init)

main :: Effect Unit
main = do
  packages <- init "/path/to/elm-application"
  -- use the packages

Compatibility with NPM License Checker

Statuses are:

  • ⭕ implemented
  • ❌ ignored
  • 📈 decided to be implemented but not yet done
  • 📉 decided to be ignored but not yet done
  • ⌛ not decided whether implemented or not

Options

OptionCLIJSPSDescription
productiononly show production dependencies
developmentonly show development dependencies
start📈give where elm.json is
unknownreport guessed licenses as unknown licenses
onlyunknownonly list packages with unknown or guessed licenses
json📈output in json format
csvoutput in csv format
csvComponentPrefixprefix column for component in csv format
outwrite the data to a specific file
customPathadd a custom format file in JSON
excludeexclude modules which licenses are in the comma-separated list from the output
relativeLicensePathoutput the location of the license files as relative paths
summaryoutput a summary of the license usage
failOnfail (exit with code 1) on the first occurrence of the licenses of the semicolon-separated list
onlyAllowfail (exit with code 1) on the first occurrence of the licenses not in the semicolon-separated list
packagesrestrict output to the packages (package@version) in the semicolon-separated list
excludePackagesrestrict output to the packages (package@version) not in the semicolon-separated list
excludePrivatePackagesrestrict output to not include any package marked as private
directlook for direct dependencies only

Custom Format

There are compatible fields:

  • name
  • version
  • description the same as summary
  • copyright always empty
  • licenses the same as license
  • licenseFile
  • licenseText
  • licenseModified always empty

There are added fields:

  • summary
  • license
2.4.0

3 years ago

2.3.0

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago