Socket
Book a DemoInstallSign in
Socket

react-string-format

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-string-format

TypeScript maybe monad for reaching child fields inside complicated objects.

Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
12K
-4.87%
Maintainers
1
Weekly downloads
 
Created
Source

react-string-format

TypeScript maybe monad for reaching child fields inside complicated objects.

Usage

Installation:

npm install react-string-format

Import

import { format } from 'react-string-format';

Format number or test

format('number: {0}, text: {1}', 1, 'bla');
// result:
('number: 1, text: bla');

Format react component

format('hiperlink: {0}, span tag: {1}', <a href="#">Link</a>, <span>Bla</span>);
// result:
<React.Fragment>
    <React.Fragment key={0}>hiperlink: </React.Fragment>
    <React.Fragment key={1}>
        <a href="#">Link</a>
    </React.Fragment>
    <React.Fragment key={2}>, span tag: </React.Fragment>
    <React.Fragment key={3}>
        <span>Bla</span>
    </React.Fragment>
</React.Fragment>;

Keywords

ract

FAQs

Package last updated on 04 Mar 2020

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