string-converter
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.4 • Public • Published

    string-converter

    Converts strings to other javascript types

    Build Status Codacy Badge code style: prettier Coverage Status David GitHub npm

    Installation

    npm install string-converter

    Usage

    import { convert } from "string-converter";
    
    const numericValue = convert("42");
    ==> 42
    
    const booleanValue = convert("1");
    ==> true
    
    const stringValue = convert("some string");
    ==> "some string"
    
    const objectWithValue = {
      value: 42,
      toString: () => value.toString()
    };
    const stringValue = convert(objectWithValue);
    ==> "42";

    Docs

    https://jaspenlind.github.io/string-converter

    Test

    npm test

    Install

    npm i string-converter

    DownloadsWeekly Downloads

    15

    Version

    1.3.4

    License

    MIT

    Unpacked Size

    13.9 kB

    Total Files

    33

    Last publish

    Collaborators

    • jaspenlind