Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 19 hours 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-25T18:24:40.000Z (26 days ago)
- Last Synced: 2024-10-29T23:19:32.799Z (22 days ago)
- Topics: javascript, javascript-library, utility-library
- Language: JavaScript
- Homepage:
- Size: 575 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Structkit
Javascript framework in using functional syntax for programmer.[![NPM version][npm-image]][npm-url]
[![NPM version][npm-ts-image]][npm-url-ts][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) ([~74KB](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 htmlCJS, 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.842-brightgreen
[npm-ts-image]: https://img.shields.io/badge/structkit:ts-1.4.8-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
```