npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

topolo

v0.1.4

Published

A simple task runner

Downloads

51

Readme

Topolo

Stuff to do:

  • implement "before", "after", "optionalBefore", and "optionalAfter"
  • implement allowing command to be an array
  • allow commonjs export config file
  • better error messages
  • documentation
  • full test coverage
// Ideal stanza?

export default {
  build: {
    command: 'webpack',
    dependencies: {
      before: ['a'],
      after: 'b',
      optionalBefore: 'c',
      optionalAfter: 'd',
      anytime: 'e'
    }
  }
}

Description

Similar to grunt/gulp in that it is a task runner, except everything is command-line based.

Tasks: each task has a name, and an object/string for a value. The name is the key, it's what you will call the task with. The value can either be a "command", or an object with more definitions.

Command: A command is a command-line command to be run for this task. A command can be:

  • a string. This will be executed in a cross-platform(ish) way, and it will "complete" when it's done
  • an array of strings. This will run each string within as a "string command" sequentially ([2] will only be run after [1] completes)
  • a function. This will be invoked just before the command needs to be run, and it should return a string. Function is invoked with the "params" of the call (parameters are defined as anything after a colon in a "calling" task name)

Env: Environment variables can be provide for this task. They will apply to all commands (if more than one) in the task, and will not apply to any other tasks (before, after, or during)

Deps:

Dependencies are defined on the "deps" or "dependencies" key (they are merged and treated the same). They can be:

  • a string. This taks will be run before the task you are defining
  • an array. The task names in the array will be run before the task you are defining. This does not define order, just that they should be run before this task.
  • an object. The object can include a complex definition for what will run before, after, and even during this task. It can contain the following keys:
    • before: a string or an array of strings which can define tasks to run before this task
    • after: a string or an array of strings which can define tasks to run after this task
    • any: a string or an array of strings which can define tasks that must run, but can run at any time in comparison to this task
    • optionalBefore: a string or an array of strings which can define tasks that should run before this task, but only if another task (or the user) requires it
    • optionalAfter: a string or an array of strings which can define tasks that should run after this task, but only if another task (or the user) requires it

Arch:

Systems:

the "read" pass - this will read in the config file either from the default location, or from the command line flag passed in.

the "expand" pass - this will take any "shortcut" definitions (ex. a string as a "dep" value) and will expand it to a fully defined task object with empty arrays/sensable defaults. (don't mess with the "command" key, as that should be invoked if it's a function, then reconciled right before execution)

the "collect" pass - this will run through the given "start tasks" and will create a list of "required" tasks that must be run (in no specific order).

the "graphbuilding" pass - this will convert all of the different dependencies into "before" dependencies (which may or may not be a DAG at this point)

the "sort" pass - this will topologically sort the tasks to ensure there are no cyclical dependencies and to make sure that the DAG resolves correctly.

the "run" pass - this will run each task with maximum concurrency, returning (via promise) when complete.