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

workflow-core

v2.0.0

Published

Workflow-centric workspace manager

Downloads

109

Readme

workflow-core

Workflow is an experiment in declarative virtual workspace management. Workflow aims to simplify navigating complex window configurations. It does so by letting the user define layouts and a way to easily navigate between them. Workflow is meant to be an abstraction layer on top of window managers like i3, awesome, and the proprietary ones found in OSX and Windows.

For more documentation checkout the Repository on github.

Documentation

The workflow-core module contains a single function. This function accepts a configuration object to builds a facade which can be used to execute workflow. The workflow-cmd module read the workflow-home config.js file and builds the facade and contains a run function which uses the facade to provide the functionality of the command workflow.

const workflow = require('workflow-core').workflow(config);

The configuration object

const config = {

  resolvers: [
    {
      function resolve(path) {
        // Returns the absolute path of a flow found with the `path` argument.
        // Throws an error if the flow is not found or is a directory.
      },
      function alternatives(path) {
        // Returns a list of possible flows filtered by the path argument.
        // Throws an error if the path or dirname(path) is not a directory.
        // Returns an empty list if no files are found.
      }
    }
  ],
  
  loaders: [
    {
      loader: { 
        function load(path) {
          // Load the flow found on the path.
          // Throws an error if the flow could not be loaded by the loader
        } 
      },
      
      function filter(path) {
        // Optional function to determine if the loader should be used for the path.
        // If the function returns false, the loader is skipped.
        // If the function is not defined, the loader is always used
      } 
    }
  ], 
  
  argumentParser: {
    function parse(flow, argv) {
      // parses the arguments given in argv as defined by the flow
    }
  },
  
  transformers: [
    { 
      function transform(flow, args) {
        // Performs a transform to and from a valid `AFT`.
      }
    }
  ],
  
  layout: { 
    function layout(args, { screen }) {
      // Performs a transformation from an `AFT` to a `CFT` which 
      // supported by the windows manager adapter
    }
  }
  
  wm: {
    function screen() {
      // Returns the dimensions of the screen 
    },
    
    function apply(flow) {
      // Applies the flow by opening applications and position them
      // on the screen.
    }
  }

};

The facade

const workflow = {
  
  // Call all available resolvers and return the absolute path 
  //returned by the first resolver which provides a valid result
  resolve(path: string): string,
  
  // Ask all resolvers for the valid paths the can resolve 
  // and return the combined results
  alternatives(path: string): Array<string>,
  
  // Ask all loaders to load the flow at given at the absolute path.
  // The result of the first loader that loads the file without any 
  // errors is returned. 
  load(path: string): Flow,
  
  // Parse the command line arguments require by the Flow
  parseArguments(flow: Flow, args: Array<string>): Args,
  
  // Preform any transformation on the Flow
  transform(flow: Flow, args: Args): Flow,
  
  // Convert the Flow given as a `AFT` into the corresponding flow 
  // as a `CFT`. Refer to the `workflow-layout` package for addition details.
  layout(flow: Flow, config: {screen: Screen}): Flow,
  
  // Returns the screen dimensions
  screen(): Screen,
  
  // Applies the Flow by opening applications and positioning then
  // on the screen.
  apply(flow: Flow): void
}