https://github.com/mathigon/core.js
General purpose JavaScript library.
https://github.com/mathigon/core.js
arrays typescript utilities
Last synced: 4 months ago
JSON representation
General purpose JavaScript library.
- Host: GitHub
- URL: https://github.com/mathigon/core.js
- Owner: mathigon
- License: mit
- Created: 2014-09-15T21:34:54.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2025-02-12T13:33:07.000Z (over 1 year ago)
- Last Synced: 2025-09-08T14:46:32.378Z (10 months ago)
- Topics: arrays, typescript, utilities
- Language: TypeScript
- Homepage: http://mathigon.io/core
- Size: 1.07 MB
- Stars: 12
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Core.ts
[](https://github.com/mathigon/core.js/actions?query=workflow%3A%22CI+Tests%22)
[](https://www.npmjs.com/package/@mathigon/core)
[](https://github.com/mathigon/core.js/blob/master/LICENSE)
Core.ts is a library of TypeScript utility function and classes, including array
and string helpers, function wrappers and event classes. It was developed for
[Mathigon.org](https://mathigon.org), an award-winning mathematics education
project.
## Features
* Function wrappers for caching and throttling (`cache()`, `throttle()`)
* Array generation (`tabulate()`, `repeat()`, `list()`)
* Array utilities (`total()`, `flatten()`, `chunk()`, `intersect()`, …)
* String utilities (`toCamelCase()`, `isPalindrome()`, `autoCorrect()`, …)
* Event Target class, supporting `.on()`, `.off()` and `.trigger()` methods
* Color parsing, conversion and interpolation
* Misc utilities (`uid()`, `isOneOf()`, …)
## Usage
First, install Core.ts from [NPM](https://www.npmjs.com/package/@mathigon/core)
using
```npm install @mathigon/core```
Now, simply import all functions and classes you need, using
```js
import {tabulate, toCamelCase, EventTarget} from '@mathigon/core'
```
## Contributing
We welcome community contributions: please file any bugs you find or send us
pull requests with improvements. You can find out more on
[Mathigon.io](https://mathigon.io).
Before submitting a pull request, you will need to sign the [Mathigon Individual
Contributor License Agreement](https://gist.github.com/plegner/5ad5b7be2948a4ad073c50b15ac01d39).
## Copyright and License
Copyright © Mathigon ([dev@mathigon.org](mailto:dev@mathigon.org))
Released under the [MIT license](LICENSE)