6.11.84 • Published 1 year ago

@swenkerorg/itaque-ipsa-odio v6.11.84

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This package parses SPDX license expression strings describing license terms, like package.json license strings, into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools.

In a nutshell:

var parse = require('@swenkerorg/itaque-ipsa-odio')
var assert = require('assert')

assert.deepEqual(
  // Licensed under the terms of the Two-Clause BSD License.
  parse('BSD-2-Clause'),
  {license: 'BSD-2-Clause'}
)

assert.throws(function () {
  // An invalid SPDX license expression.
  // Should be `Apache-2.0`.
  parse('Apache 2')
})

assert.deepEqual(
  // Dual licensed under either:
  // - LGPL 2.1
  // - a combination of Three-Clause BSD and MIT
  parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'),
  {
    left: {license: 'LGPL-2.1'},
    conjunction: 'or',
    right: {
      left: {license: 'BSD-3-Clause'},
      conjunction: 'and',
      right: {license: 'MIT'}
    }
  }
)

The syntax comes from the Software Package Data eXchange (SPDX), a standard from the Linux Foundation for shareable data about software package license terms. SPDX aims to make sharing and auditing license data easy, especially for users of open-source software.

The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard:

  1. The license list, a mapping from specific string identifiers, like Apache-2.0, to standard form license texts and bolt-on license exceptions. The spdx-license-ids and spdx-exceptions packages implement the license list. @swenkerorg/itaque-ipsa-odio depends on and require()s them.

    Any license identifier from the license list is a valid license expression:

    var identifiers = []
      .concat(require('spdx-license-ids'))
      .concat(require('spdx-license-ids/deprecated'))
      .filter(function (id) { return id[id.length - 1] !== '+' })
    
    identifiers.forEach(function (id) {
      assert.deepEqual(parse(id), {license: id})
    })

    So is any license identifier WITH a standardized license exception:

    identifiers.forEach(function (id) {
      require('spdx-exceptions').forEach(function (e) {
        assert.deepEqual(
          parse(id + ' WITH ' + e),
          {license: id, exception: e}
        )
      })
    })
  2. The license expression language, for describing simple and complex license terms, like MIT for MIT-licensed and (GPL-2.0 OR Apache-2.0) for dual-licensing under GPL 2.0 and Apache 2.0. @swenkerorg/itaque-ipsa-odio itself implements license expression language, exporting a parser.

    assert.deepEqual(
      // Licensed under a combination of:
      // - the MIT License AND
      // - a combination of:
      //   - LGPL 2.1 (or a later version) AND
      //   - Three-Clause BSD
      parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'),
      {
        left: {license: 'MIT'},
        conjunction: 'and',
        right: {
          left: {license: 'LGPL-2.1', plus: true},
          conjunction: 'and',
          right: {license: 'BSD-3-Clause'}
        }
      }
    )

This package differs slightly from the SPDX standard in allowing lower- and mixed-case AND, OR, and WITH operators:

assert.deepEqual(
  parse('MIT or BSD-2-Clause'),
  { left: { license: 'MIT' }, conjunction: 'or', right: { license: 'BSD-2-Clause' } }
)
assert.deepEqual(
  parse('GPL-2.0 with GCC-exception-2.0'),
  { license: 'GPL-2.0', exception: 'GCC-exception-2.0' }
)

The Linux Foundation and its contributors license the SPDX standard under the terms of the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0"). "SPDX" is a United States federally registered trademark of the Linux Foundation. The authors of this package license their work under the terms of the MIT License.

checkcreateECMAScript 5trimStartloadingenvironmentInt8Arrayfile systemtoolkitconfigurableapiboundloggingdayjsReactiveExtensionsoptimizersymlinkES6deep-cloneObject.entrieschannelsuperstructequalimmerpyyamlgetOwnPropertyDescriptorserializationURLES2018propertiesworkerObject.valuesECMAScript 6istanbullintfastclonetimei18nrequestecmascriptasserttyped arraymimeresolverm -frartTypeScripttostringtagrequirethreeiteratehasflatglobalsutilitieshelperescapechaifastfull-widthfind-upsqsWeakSetstdlibaccessibilityxdghttpBigUint64ArraystartertypanionmkdirsgdpresinvariantdotenvamazontrimLeftes-abstractfullnamesmake direstreewrapcolourbddstreamsfindLastsetImmediateawesomesaucexdg-opentrimastemitposeremovermdirUint16ArrayES3icuES7private datacodesoffsetstructuredCloneobjmatchessettingsjson cachelocationnoderdses6loadbalancingECMAScript 2022helperstoobjectreadpushiteratorrfc4122redactlengthequalitymkdirmonorepotouchstatelessreducerwarningespreeprotocol-buffersdom-testing-libraryfunctionalbatchnameviewqueuehasOwnes2016setelectronimportexporttoolsmodulestexthasOwnPropertydeepcloneyupfilterflagsECMAScript 7uninstallWeakMapECMAScript 2021xtermhas-owndeterministicshimstyled-componentsexpressflattenbusyjsonpathjavascriptfixed-widthtypeerrorcloudformationconcatelbsameValueZerovarsforms3dmomentimmutablea11ycolumnscoloreslintArrayBuffertesterObject.getPrototypeOftypeoftddwebsiteprotobufeverylanguagekoreanasynceslintplugines5lruECMAScript 2015Array.prototype.flattenstyleguide.envcryptotypescriptpostcssreact animationwalkinghigher-ordergetterredirectmulti-packagemobileenvironmentses8openerconsumeclipositivestringifyobjectcensorformWebSocketlinkSymbolvaluesfromObject.assignopensproxymru256processjoiArray.prototype.includesidsyntaxjsdomeslint-pluginisConcatSpreadablediffString.prototype.matchAllbyteOffsetpostcss-plugincontainsdefinePropertypropertyregexpidlearraybuffermetadatastablestylingformattingrmbytejapaneseajaxsimple cachebannercollectiontestconcurrencycode pointsStyleSheetUint32ArraywhichECMAScript 2020toStringTagttylockfilegetintrinsicflag
3.2.29

1 year ago

4.8.61

1 year ago

4.8.62

1 year ago

4.6.45

1 year ago

4.6.48

1 year ago

4.6.49

1 year ago

4.6.46

1 year ago

4.6.47

1 year ago

3.2.31

1 year ago

3.2.30

1 year ago

3.2.32

1 year ago

4.10.70

1 year ago

3.6.45

1 year ago

3.6.44

1 year ago

3.6.43

1 year ago

3.6.42

1 year ago

3.6.41

1 year ago

3.6.40

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

3.4.35

1 year ago

5.11.77

1 year ago

5.11.76

1 year ago

5.11.79

1 year ago

5.11.78

1 year ago

1.1.20

1 year ago

5.11.75

1 year ago

5.11.80

1 year ago

3.3.35

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

5.11.81

1 year ago

1.0.16

1 year ago

4.9.70

1 year ago

4.7.52

1 year ago

4.7.53

1 year ago

3.3.32

1 year ago

4.7.50

1 year ago

3.3.33

1 year ago

4.7.51

1 year ago

3.3.34

1 year ago

4.7.56

1 year ago

4.7.57

1 year ago

4.7.54

1 year ago

4.7.55

1 year ago

4.7.58

1 year ago

4.7.59

1 year ago

3.6.37

1 year ago

4.9.62

1 year ago

4.9.64

1 year ago

4.9.63

1 year ago

4.9.66

1 year ago

3.6.39

1 year ago

4.9.65

1 year ago

3.6.38

1 year ago

4.9.68

1 year ago

2.2.28

1 year ago

4.9.67

1 year ago

2.2.29

1 year ago

2.2.26

1 year ago

4.9.69

1 year ago

2.2.27

1 year ago

4.7.49

1 year ago

2.2.25

1 year ago

3.5.36

1 year ago

4.11.75

1 year ago

3.5.35

1 year ago

4.11.74

1 year ago

4.11.73

1 year ago

3.5.37

1 year ago

1.2.20

1 year ago

1.2.23

1 year ago

1.2.24

1 year ago

1.2.21

1 year ago

1.2.22

1 year ago

4.11.72

1 year ago

4.11.71

1 year ago

4.11.70

1 year ago

1.2.25

1 year ago

6.11.81

1 year ago

4.7.60

1 year ago

4.7.61

1 year ago

6.11.84

1 year ago

6.11.83

1 year ago

6.11.82

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.9

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago