license-text-normalizer
TypeScript icon, indicating that this package has built-in type declarations

2.3.1 • Public • Published

License Text Normalizer

Library that provides license text normalization functionality in JavaScript.

A python implementation is also available: https://github.com/quic/license-text-normalizer

Requirements

  • node 10+
  • yarn 1.9+

Installation

npm install license-text-normalizer --save

or

yarn add license-text-normalizer

Usage

Normalize a license text using the default set of delimiters

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.')

Normalize a license text using a custom set of delimiters

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.')

Development

See CONTRIBUTING.md for more information.

License

License Text Normalizer is licensed under the BSD 3-clause “New” or “Revised” License. See LICENSE for the full license text.

Package Sidebar

Install

npm i license-text-normalizer

Weekly Downloads

1

Version

2.3.1

License

BSD-3-Clause

Unpacked Size

10.5 kB

Total Files

5

Last publish

Collaborators

  • mynameistechno