Registry / web-framework / licia
library1.48.0jsnpmunverified

Licia is a zero-dependency JavaScript utility library providing over 400 micro modules for common daily development tasks. Unlike monolithic libraries, Licia's design philosophy focuses on individual, 'deadly simple' modules addressing problems across various domains, rather than strict categorization. It includes functionalities like a jQuery-style DOM module, a cookie library, robust `dateFormat`, a Promise polyfill, a micro event emitter, Ajax/fetch utilities, and common helpers found in libraries like Lodash/Underscore (e.g., `shuffle`, `unique`, `mkdir`). The current stable version is `1.48.0`, with a frequent release cadence, typically receiving minor updates every one to two weeks. For projects requiring ES module imports and optimized bundle sizes, the companion `licia-es` package is recommended, or users can leverage the online builder tool to create custom utility bundles.

npm install licia
INSTALL
IMPORT
SIG · LICIA
L
licia
web-frameworkjavascriptv1.48.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

uuid
const uuid = require('licia/uuid');
import { uuid } from 'licia';
Licia utilities are exposed as individual CommonJS modules. For ESM, use `licia-es/uuid`.
$
const $ = require('licia/$');
import { $ } from 'licia';
The DOM manipulation utility is accessed via `licia/$`. For ESM, use `licia-es/$`.
dateFormat
const dateFormat = require('licia/dateFormat');
const { dateFormat } = require('licia');
Individual utilities are imported directly by path. For ESM, use `licia-es/dateFormat`.

Demonstrates importing utilities from both the primary CommonJS `licia` package and the ESM-focused `licia-es` package for various common tasks like UUID generation, type checking, iteration, and random number generation.

import { name, random } from 'licia-es'; import isStr from 'licia-es/isStr'; const uuid = require('licia/uuid'); const { each } = require('licia/collection'); console.log(`Generated UUID: ${uuid()}`); console.log(`Is 'hello' a string? ${isStr('hello')}`); const items = [1, 2, 3]; each(items, (item, idx) => { console.log(`Item at index ${idx}: ${item}`); }); console.log(`Random number between 0 and 100: ${random(0, 100)}`); console.log(`Package name: ${name()}`);
Debug
Known issues
gotchaThe `licia` package is primarily distributed as CommonJS modules, with each utility residing in its own file (e.g., `licia/uuid`). Attempting to use named ESM imports like `import { uuid } from 'licia'` directly will likely fail or lead to inefficient bundling. For proper ES module support and optimal tree-shaking, developers should use the dedicated `licia-es` package (e.g., `import uuid from 'licia-es/uuid'`).
fix
For CommonJS environments, use `const util = require('licia/utilName')`. For ES Modules, install `licia-es` and use `import util from 'licia-es/utilName'`.
affects: >=1.0.0
breakingThe `fileSize` utility in `v1.46.0` changed its behavior to explicitly 'turn back to bytes', meaning previous versions might have returned file sizes in different default units (e.g., KB, MB). Applications relying on the previous default unit of `fileSize` will receive values in bytes after updating.
fix
Review all usages of the `fileSize` utility after updating to `v1.46.0` or newer. Adjust your application's expectations or add unit conversions if you were relying on a different default output unit in earlier versions.
affects: <1.46.0
gotchaThe `randomId` function in versions prior to `v1.41.1` had a bug where generating IDs with a `size` parameter greater than 21 could result in incorrect or truncated output due to an underlying integer overflow issue.
fix
Update `licia` to `v1.41.1` or a newer version to ensure correct `randomId` generation, especially when requesting IDs longer than 21 characters.
affects: <1.41.1
Errors
Common errors & fixes
TypeError: (0 , _licia_uuid__WEBPACK_IMPORTED_MODULE_0__.default) is not a function
Attempting to use `import { uuid } from 'licia'` in a modern bundler environment. The main `licia` package exports individual CommonJS modules, not named ESM exports from the root.
fix
For ESM, install `licia-es` and use `import uuid from 'licia-es/uuid'`. For CommonJS, use `const uuid = require('licia/uuid')`.
Cannot read properties of undefined (reading 'uuid')
Incorrectly trying to access a utility (e.g., `uuid`) as a property of the main `licia` export, like `require('licia').uuid`, when utilities are exposed as individual modules.
fix
Access the utility directly via its module path: `const uuid = require('licia/uuid')`.
Module not found: Error: Can't resolve 'licia'
The `licia` package has not been installed or is not correctly linked in the project's dependencies.
fix
Run `npm install licia` or `yarn add licia` to add the package to your project.
Upgrade
Version history
1.48.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
licia — npm install licia · libregistry