Skip to content

fiatjaf/extract-summary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

extract-summary extracts summaries from blocks of text.

const extractSummary = require('extract-summary')

let summary = extractSummary(`

<p><b>Human action</b> is <em>purposeful behavior</em>. Or we may say: Action is will put
into operation and transformed into an agency, is aiming at ends and goals, is the ego's
meaningful response to stimuli and to the conditions of its environment, is a person's
conscious adjustment to the state of the universe that determines his life. Such paraphrases
may clarify the definition given and prevent possible misinterpretations. But the definition
itself is adequate and does not need complement of commentary.</p>

(continuining HTML content...)

`, 'html')

That yields a string that can be used as a summary in blogs and similar things.

Please see the source to see a grasp of the algorithm being used. It is simple, but it is not just slicing the text without looking at it. See the tests for more examples.

Licensed in the MIT terms.

About

extracts summaries from Markdown or HTML files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published