Skip to content

Commit 6c77f1c

Browse files
committedJul 17, 2020
Merge branch 'release/v1.0.3'
2 parents 78a0782 + ab8c49b commit 6c77f1c

File tree

5 files changed

+83
-24
lines changed

5 files changed

+83
-24
lines changed
 

‎.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ language: node_js
88
node_js:
99
- stable
1010
- 12
11-
- 11
1211
- 10
1312
env:
1413
global:

‎docs/index.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>@thebespokepixel/string 1.0.2 | Documentation</title>
5+
<title>@thebespokepixel/string 1.0.3 | Documentation</title>
66
<meta name='description' content='Esoteric string formatting'>
77
<meta name="viewport" content="width=device-width,initial-scale=1">
88
<link href="assets/css/ace.min.css" rel="stylesheet">
@@ -15,7 +15,7 @@
1515
<div id='split-left' class='overflow-auto fs0 height-viewport-100 sidebar'>
1616
<div class='py1 px2'>
1717
<h3 class="m0 no-anchor">@thebespokepixel/string</h3>
18-
<div class="mb1"><code>1.0.2</code></div>
18+
<div class="mb1"><code>1.0.3</code></div>
1919
<input
2020
placeholder="Filter"
2121
id="filter-input"
@@ -270,7 +270,7 @@ <h3 class='left m0 panel-title' id='constructor'>
270270
</h3>
271271

272272

273-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L13-L15'>
273+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L13-L15'>
274274
<span>src/index.js</span>
275275
</a>
276276

@@ -338,7 +338,7 @@ <h3 class='left m0 panel-title' id='pad'>
338338
</h3>
339339

340340

341-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L51-L55'>
341+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L51-L55'>
342342
<span>src/index.js</span>
343343
</a>
344344

@@ -425,7 +425,7 @@ <h3 class='left m0 panel-title' id='tosub'>
425425
</h3>
426426

427427

428-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L61-L63'>
428+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L61-L63'>
429429
<span>src/index.js</span>
430430
</a>
431431

@@ -487,7 +487,7 @@ <h3 class='left m0 panel-title' id='tosuper'>
487487
</h3>
488488

489489

490-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L69-L71'>
490+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L69-L71'>
491491
<span>src/index.js</span>
492492
</a>
493493

@@ -549,7 +549,7 @@ <h3 class='left m0 panel-title' id='asemoji'>
549549
</h3>
550550

551551

552-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L79-L82'>
552+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L79-L82'>
553553
<span>src/index.js</span>
554554
</a>
555555

@@ -612,7 +612,7 @@ <h3 class='left m0 panel-title' id='inbox'>
612612
</h3>
613613

614614

615-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L89-L106'>
615+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L89-L106'>
616616
<span>src/index.js</span>
617617
</a>
618618

@@ -689,7 +689,7 @@ <h3 class='left m0 panel-title' id='bespokestring'>
689689
</h3>
690690

691691

692-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L122-L124'>
692+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L122-L124'>
693693
<span>src/index.js</span>
694694
</a>
695695

@@ -765,7 +765,7 @@ <h3 class='left m0 panel-title' id='pad'>
765765
</h3>
766766

767767

768-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L133-L135'>
768+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L133-L135'>
769769
<span>src/index.js</span>
770770
</a>
771771

@@ -859,7 +859,7 @@ <h3 class='left m0 panel-title' id='box'>
859859
</h3>
860860

861861

862-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L143-L145'>
862+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L143-L145'>
863863
<span>src/index.js</span>
864864
</a>
865865

@@ -944,7 +944,7 @@ <h3 class='left m0 panel-title' id='tosubscript'>
944944
</h3>
945945

946946

947-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L152-L154'>
947+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L152-L154'>
948948
<span>src/index.js</span>
949949
</a>
950950

@@ -1020,7 +1020,7 @@ <h3 class='left m0 panel-title' id='tosuperscript'>
10201020
</h3>
10211021

10221022

1023-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L161-L163'>
1023+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L161-L163'>
10241024
<span>src/index.js</span>
10251025
</a>
10261026

@@ -1096,7 +1096,7 @@ <h3 class='left m0 panel-title' id='emoji'>
10961096
</h3>
10971097

10981098

1099-
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/00cfc1e06c816edf38220b2d33572745a8ae653c/src/index.js#L170-L172'>
1099+
<a class='pl3 pr1 right rounded github' href='https://MarkGriffiths@github.com/thebespokepixel/string/blob/686074d7a1f970d9fc455f0d907c0f7a6654ce18/src/index.js#L170-L172'>
11001100
<span>src/index.js</span>
11011101
</a>
11021102

‎package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thebespokepixel/string",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Esoteric string formatting",
55
"main": "index.js",
66
"module": "index.mjs",
@@ -101,10 +101,7 @@
101101
],
102102
"Development Status": [
103103
[
104-
"greenkeeper",
105-
"travis-com-dev"
106-
],
107-
[
104+
"travis-com-dev",
108105
"david-dev",
109106
"david-devdeps-dev"
110107
],

‎readme.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# @thebespokepixel/string
2+
3+
> A collection of enhanced formats and utilities for strings.
4+
5+
##### Publishing Status
6+
7+
[![npm](https://img.shields.io/npm/v/@thebespokepixel/string?logo=npm)](https://www.npmjs.com/package/@thebespokepixel/string "npm") [![David](https://david-dm.org/thebespokepixel/string/master/status.svg)](https://david-dm.org/thebespokepixel/string/master "David")
8+
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/master?logo=travis)](https://travis-ci.com/thebespokepixel/string "Travis") [![Rollup](https://img.shields.io/badge/es6-module%3Amjs_%E2%9C%94-64CA39?&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0Ij4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZmlsbD0iI0ZGMzMzMyIgZD0iTTEwLjkwNDI4MjQsMy4wMDkxMDY4MyBDMTEuMjM4NzA1NSwzLjU4MjgzNzEzIDExLjQyODU3MTQsNC4yNDQ4MzM2MyAxMS40Mjg1NzE0LDQuOTUwOTYzMjIgQzExLjQyODU3MTQsNi40MTc4NjM0IDEwLjYwODY5NTcsNy42OTU2MjE3MiA5LjM5MTgyNzM5LDguMzc2NTMyNCBDOS4zMDU1MjQ2OCw4LjQyNDg2ODY1IDkuMjczMTYxMTYsOC41MzIwNDkwNCA5LjMxODQ3MDA5LDguNjE4MjEzNjYgTDExLjQyODU3MTQsMTMgTDUuMjU4NjgyODEsMTMgTDIuMzM5Nzc3MjMsMTMgQzIuMTUyMTIzNDUsMTMgMiwxMi44NDgyNzU3IDIsMTIuNjUzODA0OCBMMiwxLjM0NjE5NTIyIEMyLDEuMTU0OTk2ODggMi4xNDgzMTU0MywxIDIuMzM5Nzc3MjMsMSBMNy42N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4MjQxLDUuMzY3MDc1MzEgNy4xMTk5MDg0Nyw0LjEyMjk0MjIxIDcuNjExODMzOTMsMy4wMDQ5MDM2OCBDOC4wOTA4MTM5OSwxLjkxNDE4NTY0IDEwLjAxOTY3OTYsMi4xMjAxNDAxMSAxMC45MDY0NCwzLjAwOTEwNjgzIEMxMC44NzgzOTE2LDIuOTYyODcyMTUgMTAuODUwMzQzMiwyLjkxNjYzNzQ4IDEwLjgyMjI5NDksMi44NzI1MDQzOCBDMTAuMzA0NDc4NiwyLjI1MjUzOTQgOS41MDQwMjA5MiwxLjkwMzY3Nzc2IDguNzEwMDM1OTYsMS45MDM2Nzc3NiBDNy4xOTk3Mzg0OCwxLjkwMzY3Nzc2IDYuODIwMDA2NTQsMi40MjY5NzAyMyAzLjkyMDIzNTM3LDcuNjE5OTY0OTcgQzIuMzg3Nzk5MzQsMTAuMzY1NDA2NyAyLjAxMDgzMTkzLDExLjU3MzUwNzkgMi4wMDYyOTA2OSwxMi4xNjk4MTgyIEMyLDEyLjk5NTg0OTUgMi4wMDYyOTA2OSwxMi45OTU4NDk1IDIuODQ2NzQ2MDMsMTIuOTk1ODQ5NSBaIi8%2BCiAgPC9nPgo8L3N2Zz4K)](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")
9+
10+
##### Development Status
11+
12+
[![Travis](https://img.shields.io/travis/com/thebespokepixel/string/develop?logo=travis)](https://travis-ci.com/thebespokepixel/string "Travis") [![David](https://david-dm.org/thebespokepixel/string/develop/status.svg)](https://david-dm.org/thebespokepixel/string/develop "David") [![David-developer](https://david-dm.org/thebespokepixel/string/develop/dev-status.svg)](https://david-dm.org/thebespokepixel/string/develop?type=dev "David-developer")
13+
[![Snyk](https://snyk.io/test/github/thebespokepixel/string/badge.svg)](https://snyk.io/test/github/thebespokepixel/string "Snyk") [![Code-climate](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/maintainability)](https://codeclimate.com/github/thebespokepixel/string/maintainability "Code-climate") [![Coverage](https://api.codeclimate.com/v1/badges/57bf94c1bc96b928b8cd/test_coverage)](https://codeclimate.com/github/thebespokepixel/string/test_coverage "Coverage")
14+
15+
##### Documentation/Help
16+
17+
[![Inch](https://inch-ci.org/github/thebespokepixel/string.svg?branch=master&style=shields)](https://inch-ci.org/github/thebespokepixel/string "Inch") [![Twitter](https://img.shields.io/twitter/follow/thebespokepixel?style=social)](https://twitter.com/thebespokepixel "Twitter")
18+
19+
20+
## Usage
21+
22+
#### Installation
23+
24+
```shell
25+
npm install --save @thebespokepixel/string
26+
```
27+
28+
#### Example
29+
30+
```js
31+
const bString = require('@thebespokepixel/string')
32+
33+
console.log(bString.subScript('String to print'))
34+
```
35+
36+
#### .pad(string, char, length)
37+
38+
Pads `string`, using `char` to `length` characters. If length is negative, pads the right rather than the left of `string`. If length is less than `string.length`, it will crop `string` to fit.
39+
40+
#### .toSuperscript(string) | .toSubscript(string)
41+
42+
Prints the string using the alternative super/sub characters available in Unicode (Such as in DejaVu Sans Mono or Source Code Pro). Superscript support is much more complete that Subscript. Unavaiable subscript characters will be printed as ``. The character `Q` has to be approximated.
43+
44+
TODO: Use compound Unicode overlay characters to better approximate missing chars.
45+
46+
Unless the environment has `TERM_FONT=full` set (see [Term-NG][termNG]) and you have a Unicode terminal font that supports sub/super-script characters, then it will fall back to printing normal characters.
47+
48+
##### Character set (Github display is incomplete)
49+
50+
| Class | Numerals | Symbols | Lower case | Upper case | |
51+
| ----------- | ------------ | ------------ | ---------------------------- | ---------------------------- | ---------------------------- |
52+
| Basic | `0123456789` | \`+-=:()/ | . \` | `abcdefghijklmnopqrstuvwxyz` | `ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
53+
| Superscript | `⁰¹²³⁴⁵⁶⁷⁸⁹` | `⁺⁻⁼⁼⁽⁾╵╵⋅ ` | `ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᵍʳˢᵗᵘᵛʷˣʸᶻ` | `ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴼᴿˢᵀᵁⱽᵂˣʸᶻ` | |
54+
| Subscript | `₀₁₂₃₄₅₆₇₈₉` | `₊₋₌₌₍₎╷╷. ` | `ₐₓₓₓₑₓₓₕᵢⱼₖₗₘₙₒₚₓᵣₛₜᵤᵥₓₓₓₓ` | `ᴀʙcᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ` | |
55+
56+
[termNG]: https://www.npmjs.com/package/term-ng
57+
58+
59+
## Documentation
60+
61+
Full documentation can be found at [https://thebespokepixel.github.io/string/][1]
62+
63+
[1]: https://thebespokepixel.github.io/string/

0 commit comments

Comments
 (0)
Please sign in to comment.