flauc / otfs

A simple npm library that creates nicely formatted template strings from objects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OTFS

A light weight npm library for converting objects in to properly indented ES6 template strings.

Install

npm install otfs

Usage

otfs has a single method called create which accepts an object and returns a template string.

const otfs = require("otfs");

let something = {
    a: "something",
    b: "something else",
    c: {
        d: "this also works",
        e: ["and this", "and this", "and this"]
    }
};

otfs.create(something)

Example

For a simple example clone this repository and check out the example folder.

About

A simple npm library that creates nicely formatted template strings from objects.

License:MIT License


Languages

Language:TypeScript 78.0%Language:JavaScript 22.0%