decode-template-string
v1.0.4
Published
Allow your js functions to support implicit template string calls
Maintainers
Readme
Allow your js functions to support implicit template string calls
npm i decode-template-stringimport 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