0.9.8 • Published 6 months ago

jisg v0.9.8

Weekly downloads
13
License
GPL-3.0
Repository
-
Last release
6 months ago

jisg

Implementations of select OEIS integer sequences in JavaScript, portially inspired by intseq.

NPM Version NPM Downloads Build Status Build Size Code Coverage Scrutinizer Code Quality Language Grade GPL 3.0

Install

yarn add jisg

Usage

Build System

import {A000045} from 'jisg'
const generator = A000045()
for (let i=0; i<43; i++) {
   console.log(generator.next().value)
}

Node

const {A000045} = require('jisg')
for (const i of A000045()) {
  console.log(i)
}

Script Tags

<script src="https://unpkg.com/jisg"></script>
<script>
const generator = jisg.A000045()
setInterval(
  function() => {
    document.write(
      generator.next().value,
      ', '
    )
  },
  666
)
</script>

Demos on CodePen

Fibonacci Sequence (A000045)

Chart of A000045 with ECharts

Pascal's Triangle (A007318)

In Your Browser

Try with RunKit

Read the Docs

Documentation

CLI Commands

  • yarn install: Install dependencies
  • yarn dev: Run tests when source files are changed
  • yarn lint --fix: Lint with ESLint
  • yarn test: Run Jest tests
  • yarn doc: Build documentation
  • yarn build: Production build
  • yarn prepublish: Prepare for publishing
  • yarn publish: Publish to npm

Feedback

Contributing

Adding a Sequence Generator

  1. Fork me and clone your repo locally.
  2. Copy the beginning of the sequence from The On-line Encyclopedia of Integer Sequences into a new entry in OEIS_START_SAMPLES in index.test.ts. Append an "n" to each integer so they are BigInt type (regex replace: /(\d+)/\1n/).
  3. Create the source file in src/oeis/ using the OEIS number (eg. "A000001.ts") and add an entry in index.ts.
  4. Implement the generator so that the test case passes (eg. yarn test -t A000001). If the test takes longer than 10 seconds, remove integers from the end of the sample until it takes less than 10 seconds.
  5. Check code style and test coverage with yarn prepublish and fix any issues.
  6. Push to GitHub and submit a pull request.

Sponsorship

0.9.8

6 months ago

0.9.7

8 months ago

0.9.0

8 months ago

0.8.0

8 months ago

0.9.2

8 months ago

0.9.1

8 months ago

0.7.9

1 year ago

0.7.8

1 year ago

0.7.7

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.2

2 years ago

0.7.3

2 years ago

0.6.9

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.5.13

2 years ago

0.5.12

3 years ago

0.5.11

3 years ago

0.5.10

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago