@danieldietrich/rich-string
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.5 • Public • Published

    npm versionvulnerabilitiesminzipped size   buildcoverage   Platform   Sponsordonatelicense   Follow

    rich-string

    A tag function that automatically aligns embedded multiline strings.

    Installation

    npm i @danieldietrich/rich-string

    Usage

    The module supports ES6 import and CommonJS require style.

    import s from '@danieldietrich/rich-string';
     
    /*
    function sayHi(name) {
        console.log('Hi ${name}, I hope you are doing well!');
    }
    */
    const res = generateSayHi(s`
     
        console.log('Hi \${name}, I hope you are doing well!');
     
    `);
     
    function generateSayHi(body: string): string {
        return s`
            function sayHi(name) {
                ${body}
            }
        `;
    }

    Copyright © 2020 by Daniel Dietrich. Released under the MIT license.

    Install

    npm i @danieldietrich/rich-string

    DownloadsWeekly Downloads

    0

    Version

    0.1.5

    License

    MIT

    Unpacked Size

    7.41 kB

    Total Files

    6

    Last publish

    Collaborators

    • danieldietrich