1.0.4 • Published 3 years ago

stryle v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Stringyle

List of contents:

  1. Brief Introduction
  2. Installation
  3. Exemplar
  4. Legal (MIT license)

Brief Introduction


A JavaScript package for ease of manipulating strings, with CSS styling for each character and basic methods.

Installation


Install Node.js if not already.

Verify npm installation with npm -v, which should return the installed version. If not refer to prior step.

To install the stryle package, use the command npm install stryle

Exemplar


For each of the following examples the code snippet below is required to satisfy the importing of the modules, and initialization of the stryle class.

var Stryle = require('stryle');
var range = require('stryle/src/range');

string = new Stryle('Hello, World!');

console.log(
    string.export()
);
Hello, World!

string.import(
    string.slice(
        0, 6
    ) + 'Stryle!'
);

console.log(
    string.export()
);
Hello, Stryle!

console.log(
    string.length()
);
13

string.replace(12, ';');
console.log(
    string.export();
);
Hello, World;

console.log(
    string.slice(7, 12)
);
World

Styling

string.style(
    'font-size: 10px;',
    [12, 0, 1, 2, 3, 4]
);
console.log(
    string.export()
);
<span style="font-size: 10px;">He</span>llo</span>, World<span style="font-size: 10px;">!</span>
string.unstyle(
    'font-size: 10px;'
);
console.log(
    string.export()
);
Hello, World!

console.log(
    range(5, 10)
);
[ 5, 6, 7, 8, 9, 10 ]

Coloring

string.color(
    'blue',
    range(0, 4)
);
console.log(
    string.export()
);
<span style="color:blue;">Hello</span>, World!
string.uncolor(
    'blue'
);
console.log(
    string.export()
);
Hello, World!

License (MIT)


PermissionsConditionsLimitations
Commercial useLicense and copyright noticeLiability
DistributionWarranty
Modification
Private use
MIT License

Copyright (c) 2022 Ivan (GitHub: ivanl-exe, E-Mail: ivan.exe@pm.me)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago