Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A minor re-write of [albertorestifo/node-dijkstra](https://github.com/albertores
## Installation

```shell
yarn add smart-parks/dijkstra
yarn add @smart-parks/dijkstra
```

## Usage
Expand Down Expand Up @@ -114,3 +114,10 @@ If `options.cost` is `false` (default behaviour) an `Array` will be returned, co
If `options.cost` is `true`, an `Object` with keys `path` and `cost` will be returned. `path` follows the same rules as above and `cost` is the total cost of the found route between nodes.

When to route can be found, the path will be set to `null`.

## Publishing to NPM

```shell
npm login --registry=https://npm.pkg.github.com/ # Generate and use a well-scoped GitHub personal access token as the password.
npm publish
```
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "dijkstra",
"name": "@smart-parks/dijkstra",
"version": "2.5.0",
"description": "An implementation of Dijkstra's algorithm",
"contributors": [
Expand All @@ -18,6 +18,9 @@
"type": "git",
"url": "https://github.com/smart-parks/dijkstra"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"scripts": {
"build": "rollup -c rollup.config.js; du index.js; gzip -c index.js | wc -c",
"watch": "rollup -c rollup.config.js --watch",
Expand Down