https://github.com/jojoee/cyclicaljs
Encode item list into "cyclical"
https://github.com/jojoee/cyclicaljs
cyclic cyclical normalization normalize
Last synced: 2 months ago
JSON representation
Encode item list into "cyclical"
- Host: GitHub
- URL: https://github.com/jojoee/cyclicaljs
- Owner: jojoee
- License: mit
- Created: 2023-08-27T13:49:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T01:41:34.000Z (over 2 years ago)
- Last Synced: 2025-01-28T08:46:36.246Z (12 months ago)
- Topics: cyclic, cyclical, normalization, normalize
- Language: JavaScript
- Homepage: https://jojoee.github.io/cyclicaljs/
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cyclicaljs
[](https://www.npmjs.com/package/cyclicaljs)
[](http://opensource.org/licenses/MIT)
[](https://github.com/semantic-release/semantic-release)
[](https://greenkeeper.io/)
[](https://codecov.io/github/jojoee/cyclicaljs)
[](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/cyclicaljs/master)
[](https://github.com/jojoee/cyclicaljs/actions/workflows/continuous-integration.yml)
[](https://github.com/jojoee/cyclicaljs/actions/workflows/release.yml)
[](https://github.com/jojoee/cyclicaljs/actions/workflows/runnable.yml)
Encode item list into "cyclical"
## Installation
```
// CommonJS
npm install cyclicaljs
const { encode } = require('cyclicaljs')
// githack
// ES6
npm install cyclicaljs
import { encode } from "cyclicaljs"
```
## Example usage
```javascript
const { encode } = require('cyclicaljs')
// example2
const nItems2 = 52
const items2 = Array.from({ length: 60 }, (_, i) => i).map(item => item % nItems2)
const encodedItems2 = encode(items2, nItems2)
console.log('encodedItems2', encodedItems2)
```

## Other languages
- Python: [jojoee/cyclical](https://github.com/jojoee/cyclical)