https://github.com/compts/structkit
The Structkit utility library that will work in browser and NodeJs
https://github.com/compts/structkit
javascript javascript-library utility-library
Last synced: 5 months ago
JSON representation
The Structkit utility library that will work in browser and NodeJs
- Host: GitHub
- URL: https://github.com/compts/structkit
- Owner: compts
- License: mit
- Created: 2021-01-03T16:58:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T07:44:19.000Z (6 months ago)
- Last Synced: 2026-01-12T16:31:17.472Z (6 months ago)
- Topics: javascript, javascript-library, utility-library
- Language: JavaScript
- Homepage:
- Size: 677 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Structkit
Javascript framework is a utility tool, that helps you simplify in dealing data issue in your projects
[![NPM version][npm-image]][npm-url]
[![NPM version][npm-ts-image]][npm-url-ts]
[](https://github.com/compts/structkit/actions)
[](https://npmtrends.com/structkit)
[](https://jsr.io/@compts/structkit)
[](https://packagephobia.now.sh/result?p=structkit)
[Site](https://structkit.codehyouka.xyz/) |
[Docs](https://structkit.codehyouka.xyz/api) |
## Why Structkit
A Javascript library that make easier in working with arrays, number,object, String and etc.
## Download
To download this JS library and install in your local library
* [Core build](https://raw.githubusercontent.com/compts/structkit/main/dist/web/structkit-full.iife.js) ([~143KB](https://raw.githubusercontent.com/compts/structkit/main/dist/web/structkit-full.iife.js))
Using npm to install in your project folder:
```shell
$ npm i structkit
```
Due to conflict in Typescript and ES, it was decided to separate in separate package for typescript(Still working in progess)
```shell
$ npm i structkit-ts
```
## How to import the Library
In a browser :
```html
```
Import on cjs
```bash
const {repeat} = require('structkit');
```
Import on ESM or TS
```bash
import {repeat} from 'structkit';
```
## Example
In a browser
```html
_stk.repeat("1",20)
//11111111111111111111
```
keep in mind `_stk` is used as global library at html
CJS, ESM and TS use this code below
```bash
repeat("1",20)
//11111111111111111111
```
If you are familiar in curry function, good thing structkit is now also supported.
```bash
test = repeat(__,20)
test("1")
//11111111111111111111
```
In the example you noticed that we can apply and arguments if we are unsure of possible that you need to pass as well no need to create a function just for value only
[npm-url]: https://www.npmjs.com/package/structkit
[npm-url-ts]: https://www.npmjs.com/package/structkit-ts
[npm-image]: https://img.shields.io/badge/structkit-1.4.873-brightgreen
[npm-ts-image]: https://img.shields.io/badge/structkit:ts-1.4.87-brightgreen
## Partial sampe you can use as your utitlity function
[get the first index of array](#first-index-of-array)
``` javascript
first([2,3,4,5])// 2
```
[get the last index of array](#last-index-of-array)
``` javascript
last([2,3,4,5])// 5
```
[get start and end of array index](#slice-array-index)
``` javascript
arraySlice([1,2],1)// [2]
```
[get sum of array](#get-sum-of-array)
``` javascript
arraySum([1,2])// 3
```