monkey-format

製作 format 函數,符合 python 等 函數用法

Usage no npm install needed!

<script type="module">
  import monkeyFormat from 'https://cdn.skypack.dev/monkey-format';
</script>

README

nodejs package monkey-format

下載我

npm install monkey-format

使用我

import { formatInit } from "monkey-format";

formatInit();

console.log("{0} {1} {2}".format("a", "b", "c")); // -> "a b c"

console.log(
    "{a} {b} {c}".format({
        a: "0",
        b: "1",
        c: "2"
    })
); // -> "0 1 2"