0.0.17 • Published 3 years ago

iotdb-format v0.0.17

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
3 years ago

iotdb-format

Yet another bloody module: simple, somewhat powerful, string formatting

This isn't really finished: it needs a proper grammar, maybe using JISON.

Format Strings

const iotdb_format = require('iotdb-format')
const d = {
    message: "Hello, World"
}

iotdb_format.format("{{ message }}") // "Hello World"
iotdb_format.format("{{ message|upper }}") // "HELLO WORLD"
iotdb_format.format("{{ xmessage|:Something Else }}") // "Something Else"
iotdb_format.format("{{ xmessage|:Something Else|lower }}") // "something else"

Format Objects

const iotdb_format = require('iotdb-format')
const d = {
    msg: {
        hello: "Hello",
        world: "World",
    }
}

iotdb_format.format({
    list: [ "{{ msg/hello }}", "{{ msg/comma|:, }}", "{{ msg/world|upper }}", 3.14 ]
}, d)

// result: { list: [ 'Hello', ',', 'WORLD', 3.14 ] }
0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

5 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago