Skip to content

Commit

Permalink
prepare for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
hornta committed Sep 18, 2021
1 parent cf83c05 commit 5535fea
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
dist
node_modules/
dist/
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# long-ts

An alternative to [https://github.com/dcodeIO/long.js](long.js) with support for ESM, CJS, UMD and [https://github.com/developit/microbundle#modern](Modern Mode). It's written in TypeScript and thus houses it's own type declarations. The only notable differences between long-ts and long.js are the removal of `Long.isLong()` in favor of using `instanceof`. All aliased shorthand methods are also removed.
An alternative to [long.js](https://github.com/dcodeIO/long.js) with support for ESM, CJS, UMD and [Modern Mode](https://github.com/developit/microbundle#modern). It's written in TypeScript and thus houses it's own type declarations.

long-ts and long.js differences:

- Removed `Long.isLong()` in favor of using `instanceof`.
- Removed all aliased shorthand methods like `eq` and `shr` and more.
- Using named export `import { Long } from 'long-ts'` instead of `const Long = require('long.js')`

## Installation

Expand All @@ -20,4 +26,25 @@ console.log(longVal.toString());

## Documentation

...
https://hornta.github.io/long-ts/modules.html

## Building

`npm run build` will also build the documentation in `/docs`

```
npm install
npm run build
```

Running tests:

```
npm run test
```

Running linter:

```
npm run lint
```
56 changes: 56 additions & 0 deletions docs/assets/highlight.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,78 @@
:root {
--light-hl-0: #001080;
--dark-hl-0: #9CDCFE;
--light-hl-1: #000000;
--dark-hl-1: #D4D4D4;
--light-hl-2: #AF00DB;
--dark-hl-2: #C586C0;
--light-hl-3: #A31515;
--dark-hl-3: #CE9178;
--light-hl-4: #0000FF;
--dark-hl-4: #569CD6;
--light-hl-5: #0070C1;
--dark-hl-5: #4FC1FF;
--light-hl-6: #795E26;
--dark-hl-6: #DCDCAA;
--light-hl-7: #098658;
--dark-hl-7: #B5CEA8;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}

@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--code-background: var(--light-code-background);
} }

@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--code-background: var(--dark-code-background);
} }

body.light {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--code-background: var(--light-code-background);
}

body.dark {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--code-background: var(--dark-code-background);
}

.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
.hl-5 { color: var(--hl-5); }
.hl-6 { color: var(--hl-6); }
.hl-7 { color: var(--hl-7); }
pre, code { background: var(--code-background); }
Loading

0 comments on commit 5535fea

Please sign in to comment.