/basic-hypertext

Primary LanguageJavaScriptMIT LicenseMIT

basic-hypertext

Description

basic-hypertext is a small and simple library that can take a body of text and replace the valid URLs with hypertext formatted URLs.

For example:

This text http://www.example.com

Is transformed into:

This text <a href="http://www.example.com">http://www.example.com</a>

Using code like the following:

import { create } from 'basic-hypertext';
const text = 'Text http://www.example.com';
const transformed = create(text);

Example

Example code can be found in ./example

Installation

$ npm i basic-hypertext

Test

$ npm i
$ npm test

Build

$ npm run build

License

basic-hypertext is released under the MIT license.