Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/wordcount

Package Overview
Dependencies
Maintainers
9
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/wordcount - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

6

build-module/index.js

@@ -83,2 +83,8 @@ /**

*
* @example
* ```js
* import { count } from '@wordpress/wordcount';
* const numberOfWords = count( 'Words to count', 'words', {} )
* ```
*
* @return {Number} The word or character count.

@@ -85,0 +91,0 @@ */

@@ -103,2 +103,8 @@ "use strict";

*
* @example
* ```js
* import { count } from '@wordpress/wordcount';
* const numberOfWords = count( 'Words to count', 'words', {} )
* ```
*
* @return {Number} The word or character count.

@@ -105,0 +111,0 @@ */

4

package.json
{
"name": "@wordpress/wordcount",
"version": "2.1.0",
"version": "2.2.0",
"description": "WordPress word count utility.",

@@ -29,3 +29,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "80d228669adadb8dfcd24b8421517fed3be2d474"
"gitHead": "1e024a20a20369af7bc9720a676fdd3837a3a105"
}

@@ -15,15 +15,15 @@ # Word Count

## Accepted Parameters
## API
```JS
count( text, type, userSettings )
````
count accepts three parameters:
1. text: A string containing the words/characters to be counted.
2. type: A string that represents the type of count. The current implementation accepts the strings 'words', 'characters_excluding_spaces', or 'characters_including_spaces'.
3. userSettings: An object that contains the list of regular expressions that will be used to count. See defaultSettings.js for the defaults.
<!-- START TOKEN(Autogenerated API docs) -->
## Usage
### count
```JS
[src/index.js#L107-L121](src/index.js#L107-L121)
Count some words.
**Usage**
```js
import { count } from '@wordpress/wordcount';

@@ -33,2 +33,15 @@ const numberOfWords = count( 'Words to count', 'words', {} )

**Parameters**
- **text** `String`: The text being processed
- **type** `String`: The type of count. Accepts ;words', 'characters_excluding_spaces', or 'characters_including_spaces'.
- **userSettings** `Object`: Custom settings object.
**Returns**
`Number`: The word or character count.
<!-- END TOKEN(Autogenerated API docs) -->
<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>

@@ -98,2 +98,8 @@ /**

*
* @example
* ```js
* import { count } from '@wordpress/wordcount';
* const numberOfWords = count( 'Words to count', 'words', {} )
* ```
*
* @return {Number} The word or character count.

@@ -100,0 +106,0 @@ */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc