plain-tag

A noop/plain JS template literal tag

ISC 5 个版本
安装
npm install plain-tag
yarn add plain-tag
pnpm add plain-tag
bun add plain-tag
README

plain-tag

Build Status Coverage Status

A fast, and essential, noop/plain JS template literal tag.

import plainTag from 'plain-tag';
// const plainTag  = require('plain-tag');
// <script src="//unpkg.com/plain-tag"></script>

plainTag`one ${2} three`;
// output: "one 2 three"

It could be used to trigger CSS minification too, through rollup plugins or others.

import css from 'plain-tag';

const style = css`
  body {
    color: green;
  }
`;

Benchmark

Following the result of node test/benchmark.js after a local install of both fake-tag and noop-tag.

plain: 1.359ms
fake: 4.578ms
noop: 10.347ms

The gist of this module fits into 89 bytes before compression.

function(b){for(var c=b[0],a=1,d=arguments.length;a<d;a++)c+=arguments[a]+b[a];return c}
版本列表
0.1.3 2020-08-06
0.1.2 2020-07-04
0.1.1 2020-07-04
0.1.0 2020-07-03
0.0.0 2020-07-03