Skip to main content
Home

latest
Works with
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score82%
Published2 years ago (0.2.0)

Stringify

0.2.0

Utilities for string transformation, published on JSR.

Installation

First of all, you need to install the package:

npx jsr add @dmnchzl/stringify
Equivalent with Yarn
yarn dlx jsr add @dmnchzl/stringify
Equivalent with pNPM
pnpm dlx jsr add @dmnchzl/stringify
Equivalent with Deno
deno add @dmnchzl/stringify
Equivalent with Bun
bunx jsr add @dmnchzl/stringify

Utilities

Below, the list of all available utilities:

toCamelCase

Set case of a string to 'camelCase'

import { toCamelCase } from '@dmnchzl/stringify';

console.log(toCamelCase('Hello World')); // helloWorld

toKebabCase

Set case of a string to 'kebab-case'

import { toKebabCase } from '@dmnchzl/stringify';

console.log(toKebabCase('Hello World')); // hello-world

toPascalCase

Set case of a string to 'PascalCase'

import { toPascalCase } from '@dmnchzl/stringify';

console.log(toPascalCase('Hello World')); // HelloWorld

toSnakeCase

Set case of a string to 'snake_case'

import { toSnakeCase } from '@dmnchzl/stringify';

console.log(toSnakeCase('Hello World')); // hello_world

getWords

Extract words from string

import { getWords } from '@dmnchzl/stringify';

console.log(getWords('Hello World')); // ['Hello', 'World']

countWords

Count words from string

import { countWords } from '@dmnchzl/stringify';

console.log(countWords('Hello World')); // 2

License

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004

Copyright (C) 2024 Damien Chazoule <dmnchzl@pm.me>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";
or

Import directly with a jsr specifier

import * as stringify from "jsr:@dmnchzl/stringify";

Add Package

pnpm i jsr:@dmnchzl/stringify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";

Add Package

yarn add jsr:@dmnchzl/stringify
or (using Yarn 4.8 or older)
yarn dlx jsr add @dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";

Add Package

vlt install jsr:@dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";

Add Package

npx jsr add @dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";

Add Package

bunx jsr add @dmnchzl/stringify

Import symbol

import * as stringify from "@dmnchzl/stringify";