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

@tideflowio/tideflow-agent

v0.8.1

Published

Tideflow.io's agent

Downloads

7

Readme

Tideflow's Self-hosted Runner

With Tideflow's Self-hosted Runner, you can run workflow's task in your own server via TideFlow

For more information, visit TideFlow.io

Usage

npx @tideflowio/tideflow-agent -t [token] -u tideflow.example.com
$ tideflow-agent --help
Usage: index [options]

Options:
  -v, --version                       output the version number
  -c, --concurrency [concurrency]     Max number of jobs the agent should process concurrently
  -t, --token [token]                 Authentication token
  -u, --url [url]                     Tideflow url
  --noupdate                          Opt-out of update version check
  -h, --help                          output usage information

Examples:
  $ tideflow-agent --help
  $ tideflow-agent -h

Environment variables

# Specify authentication token.
# Optional. Having the authentication token stored as an environment
# variable allows users to run the agent without passing the -t parameter.
# Example: d2a04f78-ff8a-4eb4-a12c-57fb7abf03a7
TIDEFLOW_AGENT_TOKEN

# Specify the URL to connect to the Tideflow's platform.
# Optional. Having the URL stored as an environment
# variable allows users to run the agent without passing the -u parameter.
# Example: http://subdomain.example.com:3000
TIDEFLOW_AGENT_URL

How to process data from previous tasks

  • type: an string that defines the kind of data retuned by the previous step (object, array, file, etc)
  • data: an object containing the task's result.

Command actions

It's possible that the agent will receive preivous tasks results. This is defined in the workflow's task parameters.

The result from previous tasks are stored in a temporal file. This file's absolute path is passed as a parameter called "tideflow_previous_file" to the command to be executed.

For example, if the command to run is meow, the agent will execute it as:

meow --tideflow_previous_file "/tmp/random_file_name"

The content of such file is a JSON object, with a format similar to:

{
  "execution": {
    "_id": "neL9r33vm38txn9e6"
  },
  "tasks": {
    "the-task-id": {
      "_id": "iesFwrdTtBToRRBzB",
      "stepIndex": 1,
      "type": "file",
      "event": "read-file",
      "createdAt": "2020-10-03T15:55:08.637Z",
      "status": "success",
      "result": {
        "files": [
          {
            "fileName": "my-first-workflow-ifg.json",
            "data": "..."
          }
        ]
      },
      "updatedAt": "2020-10-03T15:55:08.650Z"
    },
    "trigger": {
      "_id": "qJucoXaWaEJqcazoe",
      "stepIndex": "trigger",
      "type": "endpoint",
      "event": "called",
      "createdAt": "2020-10-03T15:55:08.629Z",
      "status": "success",
      "result": {
        "data": {
          "name": "Jose",
          "location": {
            "lat": 42.8867647,
            "lon": -9.2716399
          }
        }
      },
      "updatedAt": "2020-10-03T15:55:08.633Z"
    }
  }
}

NodeJS SFC actions

The result from previous tasks are stored in a file. You can get the absolute path to this file in a environment variable called TIDEFLOW_PREVIOUS_FILE. This is an example on how you can retrieve the previous actions results:

// Include the FileSystem package to read files.
const fs = require('fs')

// Grab the full path of the file that contents previous tasks results
const filePath = process.env.TIDEFLOW_PREVIOUS_FILE

// Read the file contents
const fileContents = fs.readFileSync(filePath, 'utf8')

// Conver the previous tasks results to Javascript object
const previousResults = JSON.parse(fileContents)

Contributing

If you would like to contribute to Tideflow, check out the Contributing Guide.

License

GNU GENERAL PUBLIC LICENSE

Developer Resources

  • Documentation: https://docs.tideflow.io
  • Contribute: https://docs.tideflow.io/docs/contribute