Skip to content

quic/license-text-normalizer-js

Repository files navigation

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.

About

License Text Normalizer (JavaScript)

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •