Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3imed-jaberi/arraylist-tn
This module is for use ArrayList in javascript/typescript like java dev ..
https://github.com/3imed-jaberi/arraylist-tn
arraylist collections es6 java javascript node-module node-package npm npm-module npm-package typescript
Last synced: 2 days ago
JSON representation
This module is for use ArrayList in javascript/typescript like java dev ..
- Host: GitHub
- URL: https://github.com/3imed-jaberi/arraylist-tn
- Owner: 3imed-jaberi
- License: mit
- Created: 2019-05-30T16:56:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-20T00:32:06.000Z (almost 3 years ago)
- Last Synced: 2024-07-08T10:18:05.299Z (3 months ago)
- Topics: arraylist, collections, es6, java, javascript, node-module, node-package, npm, npm-module, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/arraylist-tn
- Size: 93.8 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ARRAYLIST-TN
---
[![Build Status](https://travis-ci.org/3imed-jaberi/arraylist-tn.svg?branch=master)](https://travis-ci.org/3imed-jaberi/arraylist-tn) [![Coverage Status](https://coveralls.io/repos/github/3imed-jaberi/arraylist-tn/badge.svg?branch=master)](https://coveralls.io/github/3imed-jaberi/arraylist-tn?branch=master)
### You can now use the arraylist in your TypeScript and JavaScript code easily.
## Installation
---
```bash
# npm
npm install arraylist-tn
# yarn
yarn add arraylist-tn
```## Usage
---
#### You can use this module like [ArrayList in the JAVA](https://www.w3schools.com/java/java_arraylist.asp) .. you don't need to change any thing ..
## Support Methods
---
Please see the list [here](https://github.com/3imed-jaberi/arraylist-tn/blob/master/src/ArrayList.model.ts).
## Example
---
This is a basic example or follow all test cases [here](https://github.com/3imed-jaberi/arraylist-tn/test/ArrayList.spec.ts):
```javascript
const ArrayList = require("arraylist-tn"); // || const { ArrayList } = require ('arraylist-tn');const myList = new ArrayList();
myList.add("imed jaberi");
console.log(myList.getAll()); // [ 'imed jaberi' ]
myList.addAll(["nodejs", "js-lover", "tunisia", "red", "CA"]);
console.log(myList.getAll()); // [ 'imed jaberi', 'nodejs', 'js-lover', 'tunisia', 'red', 'CA' ]
myList.remove(4);
console.log(myList.getAll()); // [ 'imed jaberi', 'nodejs', 'js-lover', 'tunisia', 'CA' ]
console.log(myList.size()); // 5
console.log(myList.contains("CA")); // true
console.log(myList.isEmpty()); // false
myList.removeAll();
myList.addAll([100, 50, -50, 0, -100]);
myList.sort(); // you can add "asc" as params
console.log(myList.getAll()); // [ -100, -50, 0, 50, 100 ]
myList.sort("desc");
console.log(myList.getAll()); // [ 100, 50, 0, -50, -100 ]
```#### License
---
[MIT](LICENSE) © [Imed Jaberi](https://github.com/3imed-jaberi)