Socket
Book a DemoInstallSign in
Socket

punctuation-name2symbol

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

punctuation-name2symbol

Replaces punctuation mark names with their corresponding symbols

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

punctuation-name2symbol

Transform this:

hello comma world exclamation point it's a beautiful day period what's new question mark

Into this:

Hello, world! It's a beautiful day. What's new?

This is useful when dealing with speech-to-text software.

Usage:

$ npm install --save punctuation-name2symbol

In your project:

const punctuate = require("punctuation-name2symbol");

punctuate("hello comma world exclamation point what's new question mark");
// Hello, world! What's new?

You can also pass in an object if you want to disable auto-capitalization:

punctuate({
  text: "hello world period what's new question mark",
  capitalize: false
});
// hello world. what's new?

Escaping punctuation mark names is also possible:

punctuate("what is your favorite time \\period question mark");
// What is your favorite time period?

Supported punctuation:

period

comma

question mark

exclamation mark|point (or just exclamation)

hyphen|dash

colon

semi-colon

Keywords

punctuation

FAQs

Package last updated on 22 Mar 2018

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