Registry / testing / ustring

ustring

JSON →
library1.4.1jsnpmunverified

ustring is a lightweight string utility library providing common string operations such as toLowerFirst, toUpperFirst, hyphenate, humanize, camelize, endsWith, and validation helpers like is.alphanum and is.match. Current stable version is 1.4.1, with no active development (last release in 2017). It uses a simple CommonJS export pattern and has no dependencies. Alternative libraries include lodash and ramda, but ustring is smaller and more focused on string manipulation.

npm install ustring
INSTALL
IMPORT
SIG · USTRING
U
ustring
testingjavascriptv1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ustring
✓ const ustring = require('ustring')
✗ import ustring from 'ustring'
The library is CommonJS-only; ESM import may fail without a bundler or Node's --experimental-require-module.
toUpperFirst
✓ ustring.toUpperFirst('abc')
✗ ustring.toUpperFirstFirst('abc')
function name is toUpperFirst, not toUpperFirstFirst (typo in readme).
is.alphanum
✓ ustring.is.alphanum('abc123')
✗ ustring.isAlphanum('abc123')
Nested property under 'is' object.

Shows basic string transformations: toUpperFirst, hyphenate, camelize, endsWith, and alphanumeric check.

const ustring = require('ustring'); console.log(ustring.toUpperFirst('hello')); // 'Hello' console.log(ustring.hyphenate('camelCase')); // 'camel-case' console.log(ustring.camelize('hello-world')); // 'helloWorld' console.log(ustring.endsWith('hello world', 'world')); // true console.log(ustring.is.alphanum('test123')); // true
Debug
Known issues
gotchaThe function toUpperFirstFirst is a typo in the readme; should be toUpperFirst.
fix
Use ustring.toUpperFirst instead.
affects: <=1.4.1
gotchaendsWith converts arguments to string; works with numbers but may cause unexpected coercion.
fix
Ensure arguments are strings if strict type checking is needed.
affects: <=1.4.1
gotchais.email is mentioned in readme as commented-out; not available in the library.
fix
Do not rely on ustring.is.email; use a dedicated email validator.
affects: <=1.4.1
Errors
Common errors & fixes
TypeError: ustring.toUpperFirstFirst is not a function
Typo in readme: function name is toUpperFirst not toUpperFirstFirst.
fix
Use ustring.toUpperFirst('abc')
Cannot find module 'ustring'
Missing npm install or incorrect module path.
fix
Run 'npm install ustring' and ensure require path is correct.
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
ustring — npm install ustring · libregistry