Node.js

Getting started with ADSJS in Node.js.

This guide explains how to use ADSJS with CommonJS module format which is usually default for Node.js projects.

To add ADSJS into your project run the following command in terminal (from project directory):

npm install ads-js

Then give it a try in your source code:

const SinglyLinkedList = require('ads-js').SinglyLinkedList;
// or
const SinglyLinkedList = require('ads-js/lists').SinglyLinkedList;

const list = new SinglyLinkedList([1, 2, 3]);
const position = list.getLast();

console.log(position.element);

Visit PUBLIC API section to get further details about capabilities of this library.

Last updated

Was this helpful?