Skip to content

Commit 62c9325

Browse files
committed
docs: updates README
1 parent c7ebb3a commit 62c9325

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
[![NPM Version](https://img.shields.io/npm/v/@dschz/load-script.svg?style=for-the-badge)](https://www.npmjs.com/package/@dschz/load-script)
22
[![Build Status](https://img.shields.io/github/actions/workflow/status/dsnchz/load-script/ci.yaml?branch=main&logo=github&style=for-the-badge)](https://github.com/dsnchz/load-script/actions/workflows/ci.yaml)
3-
[![bun](https://img.shields.io/badge/maintained%20with-bun-cc00ff.svg?style=for-the-badge&logo=bun)](https://bun.sh/)
3+
[![TypeScript](https://img.shields.io/badge/TypeScript-supported-blue?style=for-the-badge&logo=typescript)](https://www.typescriptlang.org/)
4+
[![SSR Compatible](https://img.shields.io/badge/SSR-compatible-brightgreen?style=for-the-badge)](#)
45

56
# @dschz/load-script
67

7-
> Lightweight utility for dynamically loading external scripts into the browserframework-agnostic, caching-safe, and CSP-friendly.
8+
> A lightweight utility for safely loading external scripts in the browser. Fully typed, SSR-aware, framework-agnostic, and caching-safe — ideal for modern web apps and libraries.
89
910
## ✅ Features
1011

1112
- 📆 Small and framework-agnostic
1213
- 📑 Fully typed with TypeScript for autocompletion and safety
1314
- 🚫 Prevents duplicate script injection via internal cache
15+
- 🛡️ Safe to import and use in SSR and non-browser environments
1416

1517
## 📦 Installation
1618

@@ -51,6 +53,7 @@ Loads an external script dynamically and returns a `Promise<HTMLScriptElement>`.
5153
- Scripts are cached by `src`. If `innerHTML` or `textContent` is set, the script will not be cached.
5254
- A nil (`undefined`/`null`) container value will append the script to `document.head`.
5355
- Cleanup is not automatic — script elements remain in the DOM
56+
- ❄️ SSR-safe: The function will reject gracefully when called in server environments without crashing. No DOM APIs are accessed until the environment is confirmed to be browser-based.
5457

5558
## 💬 Feedback & Contributions
5659

0 commit comments

Comments
 (0)