Library that provides license text normalization functionality in JavaScript.
A python implementation is also available: https://github.com/quic/license-text-normalizer
- node 10+
- yarn 1.9+
npm install license-text-normalizer --save
or
yarn add license-text-normalizer
import { strict as assert } from 'assert';
import normalizeLicenseText from 'license-text-normalizer';
const text = `/* Copyright 2010 Google Inc. All Rights Reserved.\n */`
assert(normalizeLicenseText(text) === 'Copyright 2010 Google Inc. All Rights Reserved.')
import { strict as assert } from 'assert';
import normalizeLicenseText from 'license-text-normalizer';
const text = `XXX\nCopyright 2010 Google Inc. All Rights Reserved.`
assert(normalizeLicenseText(text, {leadingDelimiters: ['XXX']}) === 'Copyright 2010 Google Inc. All Rights Reserved.')
See CONTRIBUTING.md for more information.
License Text Normalizer is licensed under the BSD 3-clause “New” or “Revised” License. See LICENSE for the full license text.