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

@thang2162/wordfrequency

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thang2162/wordfrequency

A simple script to count the frequency of words in a string.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

WordFrequency

A simple script to count the frequency of words in a string.

Installation

npm install @thang2162/wordfrequency --save

or

yarn add @thang2162/wordfrequency

Arguments

  1. String (required) - String to be processed.
  2. SortBy (optional) - 'desc' for descending or 'asc' ascending. Example:

WordCounter(String, SortBy).then(res => { alert(JSON.stringify(res)); });

This returns a sorted object array.

Usage

  import {WordFrequency} from '@thang2162/wordfrequency'
  const str = "With great power there must also come -- great responsibility.";

  WordFrequency(str, 'asc').then(res => {
    alert(JSON.stringify(res));
  });

CDN

<!DOCTYPE html>
<html>
<script src="https://thang2162.github.io/WordFrequency/cdn.min.js"></script>
<script>
  const str = "With great power there must also come -- great responsibility.";

  WordFrequency(str, 'asc').then(res => {
    alert(JSON.stringify(res));
  });

</script>
</html>

FAQs

Package last updated on 17 Sep 2021

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

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