https://github.com/chscript/algorithmlib
⚙️ Data Structure & Algorithm library written with Typescript
https://github.com/chscript/algorithmlib
algorithm commonjs data-structure esmodule javascript typescript
Last synced: 10 days ago
JSON representation
⚙️ Data Structure & Algorithm library written with Typescript
- Host: GitHub
- URL: https://github.com/chscript/algorithmlib
- Owner: chscript
- License: mit
- Created: 2023-02-10T16:48:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T10:43:34.000Z (about 3 years ago)
- Last Synced: 2025-10-20T23:42:32.958Z (7 months ago)
- Topics: algorithm, commonjs, data-structure, esmodule, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Algorithmlib
## Overview
Algorithmlib is an algorithm library that supports Common. js and ES module syntax. It can be applied to Node.js projects or projects built through ES modules to reduce the time spent in handwriting data structures or algorithms in JavaScript or TypeScript projects.
## Quick Start Guide
### Install
```shell
npm install algorithmlib
```
### Demo
1. Import `Stack` through ES module syntax
```javascript
import { Stack } from 'algorithmlib'
let a = new Stack()
a.push('element')
a.pop()
```
2. Import `Stack` through Common.js syntax
```javascript
const { Stack } = require('algorithmlib')
let a = new Stack()
a.push('element')
a.pop()
```
3. Import `Stack` through `` tag
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./node_modules/algorithmlib/dist/index.iife.js">
const { Stack } = algorithmlib
let a = new Stack()
a.push('element')
a.pop()