This package has been deprecated

Author message:

this package is never useful

string-tag
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

string-tag

A tiny tool to create string tags.

Example

import stringTag from "string-tag";
 
class MyString extends String {}
 
const ms = stringTag(MyString);
 
var str = ms`this is a custom string of ${MyString.name}`;
 
console.assert(str instanceof MyString);
console.assert(str.valueOf() === "this is a custom string of MyString");

API

export type StringTag<T> = (strings: string[], ...data: any[]) => T;
export function stringTag<T = string>(ctor?: new (...args: any[]) => T): StringTag<T>;
export default stringTag;

Readme

Keywords

Package Sidebar

Install

npm i string-tag

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

4.32 kB

Total Files

7

Last publish

Collaborators

  • ayonli