Teloce-NPM
Documentation site
Use npm packages in plain HTML, CSS and JavaScript or in Teloce components, without Node.js and without node_modules.
<!-- index.html -->
<head>
<!--
Use dayjs from teloce-npm
-->
</head>
<body>
<p id="today"></p>
<script type="module">
await use.ready;
document.getElementById("today").textContent = use("dayjs")().format("dddd, MMMM D");
</script>
</body>
pip install teloce-npm
teloce-npm install # finds the Use line, downloads dayjs, wraps it, wires up your HTML
That is the whole workflow: declare what you need, run one command, call use('name'). The same works in Teloce components (.vel and .html), in Flaxon apps and with server-side rendering.
How it works
- Scan.
teloce-npm installreads your.htmland.velfiles forUse <package> from teloce-npmlines. - Download. Each package is fetched from the npm registry and verified against its SHA-512 integrity hash.
- Check. The package is scanned for dangerous code and looked up in the OSV vulnerability database.
- Wrap or bundle. Plain scripts are wrapped so they expose a browser global. Packages that need it (ES modules with imports, CSS, fonts, workers, npm dependencies) are bundled with MinifyJS, an esbuild-based bundler for Python.
- Generate.
loader.js,use.jsandmanifest.jsonare written next to your static files, and two<script>tags are added to your page. - Run. In the browser the loader loads every package.
await use.readywaits for it, anduse('name')returns the package.
Everything is plain Python plus a bundled esbuild. Nothing needs Node.js at build time or at runtime.
Quick start
pip install teloce-npm
- Plain HTML, CSS and JavaScript: follow the guide. Three files and any static server.
- Teloce project: follow the walkthrough (also
pip install teloce-py). - Flaxon: Using Teloce-NPM with Flaxon.
Add or remove packages at any time:
teloce-npm install lodash@4.17.21 # install and record in teloce-npm.json
teloce-npm remove lodash
teloce-npm list
teloce-npm doctor
What you get
- No Node.js. Pure Python. Works in a plain Python container or CI job.
- Plain HTML or Teloce. No framework required.
- Reproducible.
teloce-npm.lockpins every version and integrity hash.install --frozen-lockfileis built for CI. - Secure by default. Integrity checks, a code scanner, vulnerability lookups, download and extraction limits, and a registry host allowlist. See Security.
- Works with real libraries. Tested with Monaco, Chart.js, D3, Three.js, Lodash, Day.js, marked + DOMPurify, PapaParse, Fuse.js, canvas-confetti, SortableJS, highlight.js and Supabase. See
examples/. - Small runtime. The browser side is two small generated files.
Commands
| Command | What it does |
|---|---|
teloce-npm install [pkg ...] |
Install everything declared in your files, or specific packages |
teloce-npm add <pkg> |
Alias for install <pkg> |
teloce-npm remove <pkg> |
Remove a package and its generated files |
teloce-npm update [pkg] |
Move to newer versions within your configured ranges |
teloce-npm list |
Show installed packages |
teloce-npm info <pkg> |
Show registry information about a package |
teloce-npm search <term> |
Search the registry |
teloce-npm doctor |
Check your setup |
teloce-npm clean |
Remove the cache, generated files and lockfile |
Documentation
Status
Version 0.1.0. The command line and the file formats may still change before 1.0.
Contributing
See CONTRIBUTING.md. Security issues: see the section there.
License
MIT. See LICENSE.
Metadata
Release files for teloce-npm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| teloce_npm-0.1.0.tar.gz | 84.3 kB | Without provenance | Details for teloce_npm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| teloce_npm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for teloce_npm-0.1.0-py3-none-any.whl |
Total release size: 185.6 kB
Release files / teloce_npm-0.1.0.tar.gz
| Download URL | teloce_npm-0.1.0.tar.gz |
|---|---|
| Size | 84.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11908e1d379dec6e358d72275d45b0d31487279739fe25ee8e91ed76a7d1e3bd
|
|
BLAKE2b-256 checksum How to use checksums |
da601dc5ad6702d8e58e9ae8062a2a64d2371ce00859f41370a5156aab6ddc3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / teloce_npm-0.1.0-py3-none-any.whl
| Download URL | teloce_npm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 101.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
400bd2dbaaab3e7dabbca9ebc432e186a3ffdbbdd53fa76c00a756830c6d3b04
|
|
BLAKE2b-256 checksum How to use checksums |
c04b52cd93aa8502f26101b6b015f923ac88d7e89d22610583953a331ed386ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for teloce-npm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.