Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

decode-template-string

hmyang33331MIT1.0.4

Allow your js functions to support implicit template string calls

template-string, decode, implicit-call, es6, transform, check, javascript, utility

readme

中文文档 | 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