Page MenuHomeSealhub

README.md
No OneTemporary

README.md

# add-to-head
A simple library that lets you dynamicall add some CSS or JS to the
HEAD of your HTML document. If the JS or CSS asset is already present
in the document, it's not added a second time.
```
import { addCSS, addJS } from "@sealcode/add-to-head";
addCSS("/my/style.css"); // adds a css file to the DOM
addCSS("/my/style.css"); // called second time, will not add another style link to the DOM
await addJS("/my/script.js") // add a JS script to the DOM and await until it is loaded
```

File Metadata

Mime Type
text/x-java
Expires
Tue, Feb 25, 04:10 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
610447
Default Alt Text
README.md (502 B)

Event Timeline