π¦ ExtendableString allows you to create strings on steroids that have custom transformations applied to them, unlike common, plain strings. πͺ
Installations
npm install @igor.dvlpr/extendable-string
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=20.0
Node Version
22.5.1
NPM Version
10.8.2
Score
66.4
Supply Chain
99
Quality
76.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
Download Statistics
Total Downloads
525
Last Day
1
Last Week
1
Last Month
4
Last Year
191
GitHub Statistics
1 Stars
68 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
462.00 B
Minified
295.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
2.0.0
Package Id
@igor.dvlpr/extendable-string@2.0.0
Unpacked Size
8.93 kB
Size
3.34 kB
File Count
5
NPM Version
10.8.2
Node Version
22.5.1
Publised On
29 Jul 2024
Total Downloads
Cumulative downloads
Total Downloads
525
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
-63.6%
4
Compared to previous month
Last year
-42.8%
191
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
ExtendableString
transformations applied to them, unlike common, plain strings. πͺ
π Support further development
I work hard for every project, including this one
and your support means a lot to me!
Consider buying me a coffee. β
Thank you for supporting my efforts! ππ
@igorskyflyer
π Table of contents
π΅πΌ Usage
Install it by executing:
1npm i '@igor.dvlpr/extendable-string'
π€ΉπΌ API
[!WARNING] Do NOT instantiate a new object from the
ExtendableString
class, extend it instead.
constructor(raw, transformFn)
Creates an ExtendableString instance.
raw
- The string input to transform.
transformFn
- The transformation function to apply to the string.
Will throw an error if the transformation function is not supplied.
value: string
Gets the transformed string or sets a new value that will be transformed automatically.
toString(): string
Gets the transformed string value.
Returns the transformed string.
β¨ Examples
UpperCaseString.mts
1import { ExtendableString } from '@igor.dvlpr/extendable-string' 2 3export class UpperCaseString extends ExtendableString { 4 constructor(value: string) { 5 super(value, (str) => str.toUpperCase()) 6 } 7}
example.mts
1import { UpperCaseString } from './UpperCaseString.mjs' 2 3const test = new UpperCaseString('aaaa') 4console.log(test.value) // Outputs 'AAAA' 5 6const example = new UpperCaseString('aaaa') 7example.value = 'hello' 8console.log(test.value) // Outputs 'HELLO'
π Changelog
π The changelog is available here: CHANGELOG.md.
πͺͺ License
Licensed under the MIT license which is available here, MIT license.
𧬠Related
π‘ Parse, manage, compare and output SemVer-compatible version numbers. π‘
@igor.dvlpr/astro-escaped-component
ππ»ββοΈββ‘οΈ An Astro component that holds only HTML-encoded content. π
π» Shared resources between Aria modules. π¦ββ¬
π Provides ways of checking whether a path is a legacy Windows device. πΎ
πΊ Zero-dependency Map and RegExp based string replacer with Unicode support. π
π¨π»βπ» Author
Created by Igor DimitrijeviΔ (@igorskyflyer).
No vulnerabilities found.
No security vulnerabilities found.