narwhal-js
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

narwhal-js

Build Status npm version Node.js Version

Extract different types of text in a localized string

Installation

npm i narwhal-js

Usage

import { parseString } from 'narwhal-js';

parseString('[button]<<Click>> me to [bold]<<Sign in>>');
/**
  [
    {
      type: 'button',
      value: 'Click',
    },
    {
      type: '',
      value: ' me to ',
    },
    {
      type: 'bold',
      value: 'Sign in',
    },
  ]
*/

parseString('[button]<<点>>我[bold]<<登录>>');
/**
  [
    {
      type: 'button',
      value: '点',
    },
    {
      type: '',
      value: '我',
    },
    {
      type: 'bold',
      value: '登录',
    },
  ]
*/

Readme

Keywords

none

Package Sidebar

Install

npm i narwhal-js

Weekly Downloads

3

Version

0.0.1

License

MIT

Unpacked Size

5.19 kB

Total Files

6

Last publish

Collaborators

  • mgenware