New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hide-text

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

hide-text

Utility function to hide/mask information

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Hide-text

Convert a string of characters to asterisks or any other placeholder. It's great for masking information like API keys or any other data you don't want to fully show.

Coverage StatusBuild StatusCode Style

Installation

npm i hide-text

Tests

Describe and show how to run the tests with code examples.

How to use?

After you require or import:

    let result = hideText('this is your original string', { placeholder: '#', showLeft: 4, showRight: 0, trim: 0 })
    //result -> "this ## #### ######## ######"

Config

Hide-text supports three ways to define config.

  • placeholder: character that is going to replace the original text. Default: '*'
  • showLeft: show this many characters in the left side of the string. Default: 0
  • showRight: show this many characters in the right side of the string. Default: 0
  • trim: reduce the result string to this many characters. Default: 0

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT.

Keywords

FAQs

Package last updated on 17 Oct 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