Socket
Socket
Sign inDemoInstall

deps-sort

Package Overview
Dependencies
Maintainers
40
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deps-sort

sort module-deps output for deterministic browserify bundles


Version published
Weekly downloads
988K
increased by1.31%
Maintainers
40
Weekly downloads
 
Created

What is deps-sort?

The deps-sort npm package is used to sort a stream of module dependencies in a way that ensures each module appears after its dependencies. This is particularly useful in build processes where the order of module loading is crucial.

What are deps-sort's main functionalities?

Sorting Dependencies

This feature allows you to sort a list of module dependencies so that each module appears after its dependencies. The code sample demonstrates how to use deps-sort to sort an array of module objects.

const depsSort = require('deps-sort');
const through = require('through2');

const input = [
  { id: 'a', deps: { b: 'b' } },
  { id: 'b', deps: { c: 'c' } },
  { id: 'c', deps: {} }
];

const output = [];
const sorter = depsSort();

sorter.pipe(through.obj((row, enc, next) => {
  output.push(row);
  next();
}));

input.forEach(row => sorter.write(row));
sorter.end();

sorter.on('end', () => {
  console.log(output);
});

Other packages similar to deps-sort

Keywords

FAQs

Package last updated on 29 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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