Package Exports
- @upendra.manike/string-utils
- @upendra.manike/string-utils/dist/index.js
- @upendra.manike/string-utils/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@upendra.manike/string-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
string-utils
String manipulation utilities - camelCase, slugify, truncate, CSV conversion, and more.
Installation
npm install @upendra.manike/string-utilsUsage
import { camelCase, slugify, truncate, csvToArray } from '@upendra.manike/string-utils';
// Case conversion
camelCase('hello world'); // 'helloWorld'
snakeCase('hello world'); // 'hello_world'
kebabCase('hello world'); // 'hello-world'
pascalCase('hello world'); // 'HelloWorld'
// String manipulation
capitalize('hello'); // 'Hello'
capitalizeWords('hello world'); // 'Hello World'
truncate('long text', 10); // 'long te...'
slugify('Hello World!'); // 'hello-world'
// CSV
const csv = 'name,age\nJohn,30\nJane,25';
const data = csvToArray(csv); // [{name: 'John', age: '30'}, ...]License
MIT