[![NPM version][npm-image]][npm-url] [![NPM downloads][downloads-image]][downloads-url] ![File Size][filesize-url] [![CDNJS][cdnjs-image]][cdnjs-url]
@akcybex/jsr
is a JavaScript library inspired by Laravel 'Fluent String' offering a chainable API for streamlined string manipulation and facilitating common string operations in javascript with enhanced expressiveness.
You can install @akcybex/jsr
using npm:
npm install @akcybex/jsr
Alternatively, you can use Yarn to add the package:
yarn add @akcybex/jsr
After installing, you can use @akcybex/jsr
in your Node.js application:
import { jstr } from '@akcybex/jsr';
const result = jstr('hello').repeat(3).upper().toString();
console.log(result); // Outputs: 'HELLOHELLOHELLO'
For browser-based projects, you can use the CDN link:
<script src="https://unpkg.com/@akcybex/jsr:"></script>
After including the script, jstr
will be available globally:
<script>
const result = jstr('hello').repeat(3).upper().toString();
console.log(result); // Outputs: 'HELLOHELLOHELLO'
</script>
Here are some examples of using @akcybex/jsr
:
const repeated = jstr('a').repeat(5).toString();
console.log(repeated); // Outputs: 'aaaaa'
const upper = jstr('hello').upper().toString();
console.log(upper); // Outputs: 'HELLO'
const lower = jstr('HELLO').lower().toString();
console.log(lower); // Outputs: 'hello'
const capitalized = jstr('hello world').capitalize().toString();
console.log(capitalized); // Outputs: 'Hello World'
Contributions to @akcybex/jsr
are welcome. Please refer to the contributing guidelines for more information.
This project is licensed under the MIT License.