html-excerpt-extractor
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

html-excerpt-extractor

npm build status

html-excerpt-extractor is a handy npm package that allows for extracting excerpts from HTML content. This tool can be very useful for generating content previews or search result snippets where only a portion of the HTML content is displayed.

Installation

Install the package using your favorite package manager:

npm install html-excerpt-extractor
# or
pnpm add html-excerpt-extractor
# or
yarn add html-excerpt-extractor

Usage

After installation, you can import and use the module in your JavaScript or TypeScript project:

const { extractExcerpt } = require("html-excerpt-extractor");

const htmlContent = "<div>Some <strong>important</strong> content</div>";
const excerpt = extractExcerpt(htmlContent, { length: 100 });

console.log(excerpt); // Outputs: "Some important content"

Development and Contributing

Interested in contributing to the development of this project? Great! You can clone the repository and install dependencies using pnpm:

git clone https://github.com/gravima/html-excerpt-extractor.git
cd html-excerpt-extractor
pnpm install

Feel free to report issues or submit pull requests if you have suggestions for improvements or have found bugs.

License

This project is released under the MIT License. Details can be found in the LICENSE file.

Package Sidebar

Install

npm i html-excerpt-extractor

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

15 kB

Total Files

13

Last publish

Collaborators

  • gravima