decode-template-string

1.0.4 • Public • Published

中文文档 | English Document

Allow your js functions to support implicit template string calls

npm i decode-template-string
import decode from 'decode-template-string';
const decode = require('decode-template-string');

// Support for regular functions
function print(){
  let str = decode(arguments)
  console.log(str)
}

// Support for arrow functions
const print = (...args) => {
  let str = decode(args)
  console.log(str);
}

// Now you can call your function this way👇
let name = "HMYang33";
print`My name is ${name}`;

Sub Functions

decode.check_if_calling_with_template_string
Pass Arguments, returns boolean

decode.transform_template_args_to_string
Pass Arguments, returns string

Package Sidebar

Install

npm i decode-template-string

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

5.72 kB

Total Files

8

Last publish

Collaborators

  • hmyang33