extract-summary

1.1.0 • Public • Published

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.

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i extract-summary

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • fiatjaf