New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

topological-sort

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

topological-sort - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

CHANGELOG.md

43

package.json
{
"name": "topological-sort",
"version": "0.1.5",
"description": "Topological sort implemented in Javascript",
"main": "build.js",
"version": "0.2.0",
"description": "Topological sort",
"main": "dist/index.js",
"repository": {

@@ -11,21 +11,30 @@ "type": "git",

"scripts": {
"prepublish": "./node_modules/.bin/babel index.js --out-file build.js",
"test": "mocha test/"
"build": "tsc",
"clean": "rm -fr dist/",
"lint": "tslint -p . -c tslint.json 'src/*.ts'",
"prepublishOnly": "npm run clean && npm run build",
"test:unit": "mocha --require ts-node/register src/*.spec.ts",
"test": "npm run lint && npm run test:unit"
},
"author": "Dmitry Sorin <info@staypositive.ru>",
"author": "Dmitrii Sorin <info@staypositive.ru>",
"license": "MIT",
"engines": {
"node": ">=4"
"node": ">=8"
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3",
"babel-plugin-transform-es2015-parameters": "^6.11.3",
"babel-plugin-transform-es2015-spread": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"mocha": "^2.5.3"
}
"@types/mocha": "^5.2.5",
"@types/node": "^10.5.2",
"mocha": "^5.0.0",
"ts-node": "^7.0.0",
"tslint": "^5.11.0",
"typescript": "^2.9.2"
},
"keywords": [
"topological sort",
"topological",
"sort",
"graph",
"dependencies"
],
"types": "dist/index.d.ts"
}

@@ -1,8 +0,14 @@

# Topological sort implemented in Javascript (ES2016)
# Topological sort
[![Greenkeeper badge](https://badges.greenkeeper.io/1999/topological-sort.svg)](https://greenkeeper.io/)
[![Build Status](https://img.shields.io/travis/1999/topological-sort.svg?style=flat)](https://travis-ci.org/1999/topological-sort)
[![DevDependency Status](http://img.shields.io/david/dev/1999/topological-sort.svg?style=flat)](https://david-dm.org/1999/topological-sort#info=devDependencies)
This package is distributed as Javascript, but you can also use it in your TypeScript project.
## API
### Javascript example
```javascript
const TopologicalSort = require('topological-sort');
const { TopologicalSort } = require('topological-sort');

@@ -35,2 +41,21 @@ // you can pass nodes as a map into constructor:

### Typescript example
```typescript
import TopologicalSort from 'topological-sort';
// TopologicalSort class instances have a map inside.
// This map stores the references between your nodes (edges)
// "NodesKeyType" is the type for your tree node identifiers
// "NodesValueType" is the type for your tree nodes
const nodes = new Map<NodesKeyType, NodesValueType>();
nodes.set('variables', variablesObj);
nodes.set('mixins', mixinsObj);
const sortOp = new TopologicalSort<NodesKeyType, NodesValueType>(nodes);
sortOp.addEdge('variables', 'mixins');
const sorted = sortOp.sort();
const sortedKeys = [...res.keys()]; // ['variables', 'mixins']
```
## More info:

@@ -37,0 +62,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc