New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

word-counting

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

word-counting

A very powerful words counter that supports plain text and html.

latest
Source
npmnpm
Version
1.1.4
Version published
Weekly downloads
350
110.84%
Maintainers
1
Weekly downloads
 
Created
Source

Word counting

Greenkeeper badge styled with prettier Commitizen friendly All Contributors

NPM Version License Stats Downloads Stats Github stars Github issues Build Status codecov Dev Dependencies

Donate

A very powerful words counter that supports plain text and html.

nodei.co

Why this project

  • Support node and browser environment.
  • Support html formated text. (Won't count tags)
  • Well typed

Installation

# Using npm
npm install --save word-counting

# Using yarn
yarn add word-counting

Basic Usage

Inject the library in your file:

// javascript
var wordsCounter = require('word-counting')
// typescript
import wordsCounter from 'word-counting'

Count the words for plain text:

const mockedText = 'These are some mocked words.'
console.log(wordsCounter(mockedText).wordsCount) // 5

Count the words for html:

const mockedText = '<p>These are some mocked words with html format</p>'
console.log(wordsCounter(mockedText, { isHtml: true }).wordsCount) // 8

Contributing

  • Fork it (https://github.com/nerdmax/word-counting/fork)
  • Create your feature branch (git checkout -b feature/fooBar)
  • Commit your changes (git commit -am 'Add some fooBar')
  • Push to the branch (git push origin feature/fooBar)
  • Create a new Pull Request

Contributors


Max Liu

💻 📖 🚇 ⚠️

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

count

FAQs

Package last updated on 28 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts