datavis-tech / graph-data-structure

A graph data structure with topological sort and shortest path algorithms.
MIT License
249 stars 46 forks source link

How to require the library #72

Open sebastianarena opened 11 months ago

sebastianarena commented 11 months ago

Hello, I use this library in plain NodeJs. The way to import it properly is:

const { Graph } = require('graph-data-structure')

Your documentation just says:

var Graph = require('graph-data-structure')

Which then fails when trying to call Graph().

Thank you for this awesome library!

PS: 3.4.0 is not showing up in NPM at the moment, just 3.3.0

curran commented 7 months ago

Nice catch! I'd welcome a PR for the README.

amopitt commented 5 months ago

Thanks @sebastianarena , I made a quick PR here: https://github.com/datavis-tech/graph-data-structure/pull/77