Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/sort-pkgs
Sort packages. Dependents first.
https://github.com/zkochan/sort-pkgs
Last synced: 10 days ago
JSON representation
Sort packages. Dependents first.
- Host: GitHub
- URL: https://github.com/zkochan/sort-pkgs
- Owner: zkochan
- License: mit
- Created: 2017-04-10T16:36:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-17T23:43:48.000Z (about 7 years ago)
- Last Synced: 2024-10-26T16:53:18.066Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sort-pkgs
> Sort packages. Dependents first.
[![Build Status](https://img.shields.io/travis/zkochan/sort-pkgs/master.svg)](https://travis-ci.org/zkochan/sort-pkgs) [![npm version](https://img.shields.io/npm/v/sort-pkgs.svg)](https://www.npmjs.com/package/sort-pkgs)
## Installation
```
npm i -g sort-pkgs
```## Usage
```js
const sortPkgs = require('sort-pkgs')const pkgs = sortPkgs({
'[email protected]': {
manifest: {
name: 'foo',
version: '1.0.0',
},
dependencies: ['[email protected]', '[email protected]']
},
'[email protected]': {
manifest: {
name: 'bar',
version: '2.0.0',
},
dependencies: []
},
'[email protected]': {
manifest: {
name: 'qar',
version: '3.0.0',
},
dependencies: ['[email protected]']
},
})console.log(pkgs)
//> [
// {
// manifest: {
// name: 'bar',
// version: '2.0.0',
// },
// dependencies: []
// },
// {
// manifest: {
// name: 'qar',
// version: '3.0.0',
// },
// dependencies: ['[email protected]']
// },
// {
// manifest: {
// name: 'foo',
// version: '1.0.0',
// },
// dependencies: ['[email protected]', '[email protected]']
// }
// ]
```## Related
* [find-packages](https://github.com/zkochan/find-packages) - Find all packages inside a directory
* [pkgs-graph](https://github.com/zkochan/pkgs-graph) - Create a graph from an array of packages## License
[MIT](LICENSE) © [Zoltan Kochan](http://kochan.io)