https://github.com/webreflection/plain-tag
A fast, and essential, noop/plain JS template literal tag.
https://github.com/webreflection/plain-tag
Last synced: over 1 year ago
JSON representation
A fast, and essential, noop/plain JS template literal tag.
- Host: GitHub
- URL: https://github.com/webreflection/plain-tag
- Owner: WebReflection
- License: isc
- Created: 2020-07-03T21:49:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T15:17:06.000Z (about 2 years ago)
- Last Synced: 2025-05-05T04:13:57.293Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 21
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plain-tag
[](https://travis-ci.com/WebReflection/plain-tag) [](https://coveralls.io/github/WebReflection/plain-tag?branch=master)
A fast, and essential, noop/plain JS template literal tag.
```js
import plainTag from 'plain-tag';
// const plainTag = require('plain-tag');
//
plainTag`one ${2} three`;
// output: "one 2 three"
```
It could be used to trigger CSS minification too, through rollup plugins or others.
```js
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.
```js
function(b){for(var c=b[0],a=1,d=arguments.length;a