You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

static-params

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-params - npm Package Compare versions

Comparing version

to
0.0.1

LICENSE

22

package.json
{
"name": "static-params",
"version": "0.0.0",
"description": "",
"version": "0.0.1",
"description": "A general purpose utility to allow interpolation values as static parts of a template literal tag",
"main": "./cjs/index.js",

@@ -15,3 +15,7 @@ "scripts": {

},
"keywords": ["template", "tag", "dynamic"],
"keywords": [
"template",
"tag",
"dynamic"
],
"author": "Andrea Giammarchi",

@@ -37,3 +41,11 @@ "license": "ISC",

},
"unpkg": "min.js"
}
"unpkg": "min.js",
"repository": {
"type": "git",
"url": "git+https://github.com/WebReflection/static-params.git"
},
"bugs": {
"url": "https://github.com/WebReflection/static-params/issues"
},
"homepage": "https://github.com/WebReflection/static-params#readme"
}

@@ -61,1 +61,22 @@ # static-params

```
Accordingly, it is a *very bad idea* to wrap `uhtml`, `lighterhtml`, or any similar library once, as the use case for dynamic tags, re-mapped as static content, is not so common, and every other common use case would be penalized.
It is then suggested to confine this utility as opposite of wrapping template literal tags everywhere.
```js
import {render, html} from 'uhtml';
import {asStatic, asTag} from 'static-params';
// use the specialized shtml only when needed
const shtml = asTag(html);
const el = asStatic('ul');
render(document.body, shtml`
<${el}>${
// use html for every other common use case
list.map(text => html`<li>${text}</li>`)
}</${el}>
`);
```