open-index/open-npm huggingface dataset:
npm package: @litejs/cli
Description: Command line tools for LiteJS framework
Author: Lauri Rooden
Latest version: 26.4.0


[LiteJS]: https://github.com/litejs/litejs

[1]: https://badgen.net/coveralls/c/github/litejs/cli
[2]: https://coveralls.io/r/litejs/cli
[3]: https://badgen.net/packagephobia/install/@litejs/cli
[4]: https://packagephobia.now.sh/result?p=@litejs/cli
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro

LiteJS CLI &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
==========

Command line tools for [LiteJS][] full-stack framework.

See [Quick Start Guide](https://github.com/litejs/litejs/wiki/Quick-Start)
and [wiki](https://github.com/litejs/cli/wiki) for more.

> Copyright (c) 2013-2026 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/cli) |
[npm package](https://npmjs.org/package/@litejs/cli) |
[Buy Me A Tea][6]
npm package: @litejs/dom
Description: A small DOM library for server-side testing, rendering, and handling of HTML files
Author: Lauri Rooden
Latest version: 26.4.3


[1]: https://badgen.net/coveralls/c/github/litejs/dom
[2]: https://coveralls.io/r/litejs/dom
[3]: https://packagephobia.now.sh/badge?p=@litejs/dom
[4]: https://packagephobia.now.sh/result?p=@litejs/dom
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS DOM &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
==========

Dependency-free DOM library for handling HTML, XML and CSS files on server-side.


```javascript
// const { document } = require("@litejs/dom");
import { document, CSSStyleSheet, DOMParser, XMLSerializer } from "@litejs/dom";
import { XMLHttpRequest } from "@litejs/dom/net.js";

// Build DOM manually
const el = document.createElement("h1");
el.id = 123;
el.className = "large";

const fragment = document.createDocumentFragment();
fragment.appendChild(document.createTextNode("hello"));
el.appendChild(fragment);

// Replace the DOM tree with HTML
el.innerHTML = "<b>hello world</b>";
console.log(el.toString());
// <h1 id="123" class="large"><b>hello world</b></h1>

// Minify HTML
console.log(el.toString(true));
// <h1 id=123 class=large><b>hello world</b></h1>

el.querySelectorAll("b");
// [ "<b>hello world</b>" ]

// Use XMLHttpRequest in server side
const xhr = new XMLHttpRequest();
xhr.open("GET", "https://litejs.com");
xhr.responseType = "document";
xhr.onload = function() {
	const doc = xhr.responseXML;
	// Work with DOM in familiar way
	console.log(doc.querySelector("title").textContent);
}
xhr.send();

// Minify CSS
import { CSS } from "@litejs/dom/css.js";
const sheet = new CSSStyleSheet()
sheet.replaceSync(":root{--gap:10px} .a { color: hsl(0 0% 100%); top: calc(var(--gap) + 5px) }")
console.log(CSS.minify(sheet, { var: true, calc: true, color: true }))
// .a{color:#fff;top:15px}
```

### CSS.minify options

- **calc** &ndash; resolve static `calc()` expressions, e.g. `calc(10px + 5px)` &rarr; `15px`
- **color** &ndash; shorten `rgb()`/`hsl()` to hex, e.g. `rgb(255,0,0)` &rarr; `#f00`
- **import** &ndash; inline `@import` rules, rewriting relative URLs
- **prefix** &ndash; add vendor prefixes, e.g. `{ "mask-image": ["-webkit-"] }`
- **prune** &ndash; remove unused selectors `{ keep: Set, keepRe: RegExp }`
- **root** &ndash; base directory for resolving `@import` paths
- **url** &ndash; URL rewrite callback `(path) => newPath`
- **var** &ndash; inline CSS custom properties from `:root`

## Contributing

Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.


> Copyright (c) 2014-2026 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/dom) |
[npm package](https://npmjs.org/package/@litejs/dom) |
[Buy Me A Tea][6]
npm package: @litejs/i18n
Description: Simple i18n
Author: Lauri Rooden
Latest version: 21.9.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

[1]: https://badgen.net/coveralls/c/github/litejs/crypto-lite
[2]: https://coveralls.io/r/litejs/crypto-lite
[3]: https://packagephobia.now.sh/badge?p=@litejs/i18n
[4]: https://packagephobia.now.sh/result?p=@litejs/i18n
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro
[wiki]: https://github.com/litejs/i18n/wiki


@litejs/i18n &ndash; [![Coverage][1]][2] [![size][3]][4] [![Buy Me A Tea][5]][6]
============

Translation, pluralization, date and number formating.

```javascript
i18n.def({"en": "In English"})
i18n.add("en", {
	// Numbers extension namespace
	"#": {
		".05": "# ###.05",     // Number rounded to .05
		"gas": "#/8",          // Fractions
		"money": " $# ###,05 ;n\a;($# ###,05);zero"
	},
	// Pluralization extension namespace
	"*": {
		"message": "one message;# messages"
	},
	// Selection extension namespace
	"?": {
		"friend": "friend;male=boyfriend;female=girlfriend"
	},
	// Date and time extension namespace
	"@": {
		"LT": "h:mm a",        // Local Time
		"LD": "MM/DD/y"        // Local Date
	},
	"welcome": "Hello, {user.name}!",
	"inbox": "You have {count;*message} from your {friend.sex;?friend}!"
})
var data = { user: {name: "Bob"}, count: 15, friend: { sex: "female" } })
i18n("welcome", data)
// Hello, Bob!
i18n("inbox", data)
// You have 15 messages from your girlfriend!
```

See [wiki][] for more.

## Licence

Copyright (c) 2021 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[The MIT License](http://lauri.rooden.ee/mit-license.txt) |
[Source code](https://github.com/litejs/i18n)
npm package: @litejs/s3
Description: Small S3 client
Author: Lauri Rooden
Latest version: 25.4.0


[1]: https://badgen.net/coveralls/c/github/litejs/s3
[2]: https://coveralls.io/r/litejs/s3
[3]: https://badgen.net/packagephobia/install/@litejs/s3
[4]: https://packagephobia.now.sh/result?p=@litejs/s3
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS S3 &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
=========

Dependency-free S3 client when full SDK is not needed.


### Usage


```javascript
var S3 = require("@litejs/s3")
, s3client = new S3({ accessId: ID, secret: SECRET, region: "us-east-2", endpoint: "BUCKET.s3.us-east-2.amazonaws.com" })

// More client initialization examples
, awsDeprecatedPathStyle = new S3({ region: AWS_REGION, accessId: ID, secret: SECRET, bucket: AWS_BUCKET })
, googleCloudStorage = new S3({ accessId: ID, secret: SECRET, region: "auto", endpoint: "storage.googleapis.com" })
, cloudflareR2 = new S3({ accessId: ID, secret: SECRET, region: "auto", endpoint: "MY-ID.r2.cloudflarestorage.com" })


// Use with await (throws without catch)
var data = await s3client.get("test/hello.txt")

// .. or with callback
s3client.get("test/hello.txt", function(err, data) {
	console.log("Got file", data)
})

// .. or stream to client
require("http").createServer(function(req, res) {
	s3client.get("server-test.txt", res).catch(function(err) {
		res.end(err.message)
	})
})

// bucket exists
s3client.stat("test/")
s3client.list("test/", { maxKeys: 20 })
s3client.stat("test/hello.txt")
s3client.put("test/hello.txt", "Hello world!", {
	meta: { key: "User custom metadata" },
}, function(err) {})
s3client.del("test/hello.txt")
```

> Copyright (c) 2022-2024 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/s3) |
[npm package](https://npmjs.org/package/@litejs/s3) |
[Buy Me A Tea][6]
npm package: @litejs/sqlite3
Description: Small sqlite3 command wrapper with buffer and boolean support
Author: Lauri Rooden
Latest version: 21.0.0-rc.1

[LiteJS]: https://www.litejs.com/
[npm package]: https://npmjs.org/package/@litejs/sqlite3
[GitHub repo]: https://github.com/litejs/@litejs/sqlite3

[size]: https://packagephobia.now.sh/badge?p=@litejs/sqlite3
[size-src]: https://packagephobia.now.sh/result?p=@litejs/sqlite3

Sqlite3 &ndash; [![size][size]][size-src]
=======

Small sqlite3 command wrapper with buffer and boolean support.

```javascript
var sqlite3 = require("@litejs/sqlite3")
, db = sqlite3("./test.db", {
	bin: "/bin/sqlite3",     // Default: sqlite3
	migration: "./db/test/"  // Migration sql files. Default: null
	nice: 1                  // Default: null
})

// update db.real, db.user and db.sys for each query
db.run(".timer on")

// report a number of rows affected by INSERT, DELETE, or UPDATE statement
db.run(".changes on")

db.run("CREATE TABLE t1 (id INT PRIMARY KEY, enabled BLOB, val BLOB)")
db.run("INSERT INTO t1 VALUES (?, ?)", [1, true, "str"])
db.get("SELECT id, val FROM t1 WHERE t=?", [1], function(err, row) {
	// row = { id: 1, val: 'str' }
})
db.close()

// allow the parent to exit without waiting for a child to exit
db.child.unref()

```

## External links

[GitHub repo][] |
[npm package][]


## Licence

Copyright (c) 2013-2020 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[The MIT License](http://lauri.rooden.ee/mit-license.txt)
npm package: @litejs/sun
Description: Sun position and timing calculations based on NOAA solar equations
Author: Lauri Rooden
Latest version: 26.2.0


[1]: https://badgen.net/coveralls/c/github/litejs/sun
[2]: https://coveralls.io/r/litejs/sun
[3]: https://packagephobia.now.sh/badge?p=@litejs/sun
[4]: https://packagephobia.now.sh/result?p=@litejs/sun
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS Sun &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
==========

Sun position and timing calculations based on NOAA solar equations.

```sh
$ npm install @litejs/sun
```

```javascript
import { sun } from "@litejs/sun"

let data = sun(59.437, 24.753, "2025-03-20T12:00:00Z")
console.log("Sunrise:", data.rise.time, "Sunset:", data.set.time)
// Sunrise: 2025-03-20T04:22:24.000Z Sunset: 2025-03-20T16:35:43.000Z
console.log("Azimuth:", data.azimuth, "Elevation:", data.el)
// Azimuth: 206.16 Elevation: 28.01
```

## API

### sun(lat, lon, time)

Returns an object with the following properties:

| Property       | Description                                  |
|----------------|----------------------------------------------|
| `time`         | Date object for the given time               |
| `decl`         | Solar declination (degrees)                  |
| `dur`          | Daylight duration (minutes)                  |
| `el`           | Solar elevation with refraction (degrees)    |
| `elTrue`       | Solar elevation without refraction (degrees) |
| `eqTime`       | Equation of time (minutes)                   |
| `hourAngle`    | Solar hour angle (degrees)                   |
| `azimuth`      | Solar azimuth (degrees, lazy)                |
| `dist`         | Distance to sun in AU (lazy)                 |
| `rightAsc`     | Right ascension (degrees, lazy)              |
| `noon`         | Solar noon data (lazy)                       |
| `rise`         | Sunrise data (lazy)                          |
| `set`          | Sunset data (lazy)                           |

The `noon`, `rise`, and `set` getters return objects with the same structure, with `time` refined to the exact event.
During polar day or polar night, `rise` and `set` find the nearest event, which may be days or months away.
Returns `null` only at extreme latitudes (e.g., the poles) where no sunrise or sunset occurs within a year.

## Contributing

Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.


> Copyright (c) 2025 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/sun) |
[npm package](https://npmjs.org/package/@litejs/sun) |
[Buy Me A Tea][6]
npm package: @litejs/ua
Description: Simple User-Agent parser
Author: Lauri Rooden
Latest version: 23.4.0


[1]: https://badgen.net/coveralls/c/github/litejs/ua
[2]: https://coveralls.io/r/litejs/ua
[3]: https://badgen.net/packagephobia/install/@litejs/ua
[4]: https://packagephobia.now.sh/result?p=@litejs/ua
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


User-Agent Parser &ndash; [![Coverage][1]][2] [![size][3]][4] [![Buy Me A Tea][5]][6]
=================


```javascript
var ua = require("@litejs/ua").ua

ua("Mozilla/5.0 (Mobile; rv:18.1) Gecko/18.1 Firefox/18.1")
// {os:{name:"Firefox OS",ver:"1",full:"1.1"},browser:{name:"Firefox",ver:"18",full:"18.1"},device:"Mobile"}
```


## External links

[GitHub repo](https://github.com/litejs/ua) |
[npm package](https://npmjs.org/package/@litejs/ua) |
[Coveralls coverage](https://coveralls.io/github/litejs/ua) |
[Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide) |
[Buy Me A Tea][6]


## Licence

Copyright (c) Lauri Rooden &lt;lauri@rooden.ee&gt;  
[The MIT License](http://lauri.rooden.ee/mit-license.txt)
npm package: @litejs/ui
Description: UI engine for LiteJS full-stack framework
Author: Lauri Rooden
Latest version: 26.4.0


[3]: https://packagephobia.now.sh/badge?p=@litejs/ui
[4]: https://packagephobia.now.sh/result?p=@litejs/ui
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS UI &ndash; [![Size][3]][4] [![Buy Me A Tea][5]][6]
=========

LiteJS UI is an old-school framework for high-quality web UIs,
used on heavy-traffic websites since 2006.

 - Dependency-free, weighs around 25kB (+8kB polyfills for old browsers).
 - Written in ES5, compatible with all browsers (including IE5.5).
   Works seamlessly in ESM projects too.
 - No transpiling/compiling/bundling headache, just write working code.

Includes templates, view routing, data binding, i18n, keyboard shortcuts,
touch gestures, FLIP animations.

For usage instructions, see [Quick-Start](https://github.com/litejs/litejs/wiki/Quick-Start) guide
and [wiki](https://github.com/litejs/ui/wiki).

## Examples

 - [Simplest example](https://litejs.github.io/ui/simplest.html) —
   [source](/litejs/ui/blob/main/test/html/simplest.html)
 - [Built-in routing](https://litejs.github.io/ui/routed.html) —
   [source](/litejs/ui/blob/main/test/html/routed.html)
 - [Full SVG SPA](https://litejs.github.io/ui/svg-spa.html) —
   [source](/litejs/ui/blob/main/test/html/svg-spa.html)


## Contributing

Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.

> Copyright (c) 2006-2026 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/ui) |
[npm package](https://npmjs.org/package/@litejs/ui) |
[Buy Me A Tea][6]
npm package: @litejs/xlsx
Description: Lightweight (<10KB) XLSX file creator for Browser and Node.js
Author: Lauri Rooden
Latest version: 26.1.1


[1]: https://badgen.net/coveralls/c/github/litejs/xlsx
[2]: https://coveralls.io/r/litejs/xlsx
[3]: https://badgen.net/packagephobia/install/@litejs/xlsx
[4]: https://packagephobia.now.sh/result?p=@litejs/xlsx
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS Xlsx &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
===========

Lightweight (<10KB) XLSX file creator for Browser and Node.js.

Why?  
Sometimes you just want to add `Download as Excel` button next to `Download as csv`.  
Sometimes you just want to send a simple xlsx with email without adding 30MB of packages.

Examples
--------

```javascript
const { createXlsx } = require("@litejs/xlsx");
const fileAsUint8Array = await createXlsx({
    styles: {
        My1: {
            font: { sz: 15, name: "Calibri" },
            fill: "FFFF00",
        },
    },
    sheets: [
        {
            name: 'Products',
            freeze: { rows: 1, cols: 0 },
            cols: '20,10,10', // Simple column widths
            data: [
                ['Apple', 1.99, 10],
                ['Banana', 0.99, 15],
                ['Orange', 2.49, 8],
                ['Totals', '=SUM(B1:B3)', {style: 'bold', value: '=SUM(C1:C3)'}]
            ]
        },
        {
            name: 'Types',
            cols: '20,40',
            data: [
                ['true', true],
                ['false', false],
                ['Default Date', new Date(1514900750001)],
                ['Datetime', { format: 'datetime', value: new Date(1514900750001) }],
                ['Date', { format: 'date', value: new Date(1514900750001) }],
            ]
        },
        {
            name: 'Styles',
            data: [
                [{ style: 'My1', value: 'Cell with custom stype'}, 1],
                { height: 25, data: ['Row with custom height', 2] },
            ]
        },
    ]
})
```

## Contributing

Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.


> Copyright (c) 2025-2026 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/xlsx) |
[npm package](https://npmjs.org/package/@litejs/xlsx) |
[Buy Me A Tea][6]
npm package: @litejs/zip
Description: Lightweight (~1.3KB) ZIP file creator for Browser and Node.js. No dependencies
Author: Lauri Rooden
Latest version: 25.12.0


[1]: https://badgen.net/coveralls/c/github/litejs/zip
[2]: https://coveralls.io/r/litejs/zip
[3]: https://badgen.net/packagephobia/install/@litejs/zip
[4]: https://packagephobia.now.sh/result?p=@litejs/zip
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
[6]: https://www.buymeacoffee.com/lauriro


LiteJS Zip &ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]
==========

Lightweight (~1.3KB) ZIP file creator for Browser and Node.js. No dependencies.  
Uses the CompressionStream API if available; otherwise uses provided deflater or creates an uncompressed ZIP.


createZip(files [, options] [, callback])

 - files: Array of `{name, content[, time]}`
 - options: `{ deflate: deflateRawSync, comment: 'Comment for a file' }` (optional custom deflater makes ZIP creation synchronous)
 - callback: Optional `(err, zip)` callback

Returns a `Promise<Uint8Array>`, or invokes provided `callback`, or the ZIP synchronously when using a custom deflater.


Examples
--------

```javascript
const { createZip } = require("@litejs/zip")

// Async usage
const zipUint8Array = await createZip([
    { name: "file-a.txt", content: "Some content" },
    { name: "dir/file-b.txt", content: Uint8Array.from("012"), time: new Date(2020, 1, 21) },
])

// Callback style
createZip(files, { comment: "Some comment for a zip file" }, (err, zipUint8Array) => {
    // Handle ZIP file content
})

// With custom deflate runs synchronously
const zlib = require("zlib")
const zipInSync = createZip(files, { deflate: zlib.deflateRawSync })
```

## Contributing

Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
run tests `npm install; npm test`.


> Copyright (c) 2023-2025 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
[GitHub repo](https://github.com/litejs/zip) |
[npm package](https://npmjs.org/package/@litejs/zip) |
[Buy Me A Tea][6]