Socket
Socket
Sign inDemoInstall

humanization

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

humanization

To err is human


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

humanization

semantic-release npm Build Status

humanization is a library that seeks to simulate human patterns of mistakes when typing text. It can serve as a kind of ergonomic layer for automated chatbots to make them feel more human.

Getting started

import { humanize } from "humanization";

humanize("All their equipment and instruments are alive.");
// => "Alllllllllll their eequIpmeNT anD instuments re alivve."

humanize("Thanks so much!", {
  repetition: {
    probability: 0.1,
    type: "WORD"
  },
  // Implementing a custom "thanks" applicator
  thanks: {
    probability: 1.0,
    type: "WORD",
    apply: word => (word.toLowerCase() === "thanks" ? "thx" : word)
  }
});
// => "thx sooooooo much!"

Development

  • yarn install
  • yarn watch

Testing

  • yarn test or yarn test --watch

Building

  • yarn compile

FAQs

Package last updated on 27 Aug 2019

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