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

isren

v1.1.0

Published

isren - ISsue Rendering ENgine

Downloads

4

Readme

ISREN

ISsue Rendering ENgine

ISREN is a tool aimed at providing an easy interface for pulling issue data out of a hosted Git implementation. ISREN will pull all of the issues for the given <hosted_git_url> provided at run-time. For repeatable data transformations, a transform system is available for writing custom middleware.

$ isren -h

Usage: isren [options] <hosted_git_url>

isren - ISsue Rendering ENgine

Options:
  -v, --version                          output the version number
  -a, --auth <token>                     Hosted git API authentication token
  -k, --insecure                         Ignore SSL certificate check
  -d, --debug                            Enable debug mode
  -t, --transform <transform file path>  Path to custom transform file
  -o, --out <Output file format>         The format of output file
  --out-options <Output options>         Additional options for output configuration
  --issue-options <Issue options>        Additional options for the Issue pulling
  -f, --file <Output file path>          The path of output file
  -h, --help                             output usage information

Examples

Output a CSV file:

$ isren -o csv,file -f output.csv https://gitlab.com/mygroup/exampleproject

Use a custom transform and output a JSON file:

$ isren -f /path/to/transform.js -o json,file -f output.json https://gitlab.com/mygroup/exampleproject

Documentation

Additional Docs

Data Flow

Data flow within ISREN can be visualized with the following graphic. For every change to the internals, the graphic should be updated, see CONTRIBUTING.md

Configuration

Configuration for ISREN is controlled by CLI parameters and/or a .env file. CLI parameters override any configuration set inside your .env, so params can be used for one-off changes to normal runs of ISREN.

.env

To get started with a .env file, you can copy the .env.example file:

$ cp .env.example .env

Available .env variables

  • AUTH

    • The auth token to use
  • GITLAB_URL

    • An override for custom GitLab urls, used for private enterprise versions of GitLab.
  • DEBUG

    • Enables additional debug logging.
  • ISSUE_OPTIONS

  • OUTPUT_OPTIONS

Options

Version

-v, --version

  • Get the current version of ISREN

Authentication

-a, --auth

  • Set the authentication token for the session

Insecure

-k, --insecure

  • Allow insecure/self-signed ssl certificates

Debug

-d, --debug

  • Enable debug logging

Transform

-t, --transform

  • Enable one or many (csv delimited) transforms for the session

Output

-o, --out

  • Configure the output mode(s), available options:
    • CSV
      • input: array
      • output: string
    • JSON
      • input: array
      • output: string
    • Console
      • input: any
      • output: any (whatever was input)
    • File
      • input: any
      • output: any (whatever was input)

Note: The order of the outputs is important! Data flows from the first defined output to the last, each output requires that the preceding output returns expected input data. Because of this, some outputs cannot be used together, the input/output must match for each output, e.g. -o csv,file works, but -o csv,json does not.

Output Options

--out-options

  • Enable additional output options for the session

    • Additional output file options, currently only used for CSV export types. This value is expected to be a valid JSON object using these options. For example, to change the CSV delimiter to |:

      // CLI
      --out-options='{"delimiter": "|"}'
      
      // .env
      OUTPUT_OPTIONS={"delimiter": "|"}

Issue Options

--issue-options

  • Additional filtering for issue fetching. This value is expected to be a valid JSON object using these filtering options. For example, to filter based on creation date:

    // CLI
    --issue-options='{"created_after": "2019-08-01T00:00:00.000Z"}'
    
    // .env
    ISSUE_OPTIONS={"created_after": "2019-08-01T00:00:00.000Z"}

File

-f, --file

  • The output file name and path.
    • Only used when the Output file option is included

Help

-h, --help

  • Display the help output.

Transforms

Transforms are a powerful concept in ISREN that allow us to transform issues, one at a time, to shape the internal data into a format that better serves us.

For example, given the following example issue:

{
  "id": 12345,
  "description": "lorem ipsum ..."
}

If we wanted to re-key the id to say issue_id, we can use write the following transform

// MyTransform.js
//
// usage:
// $ isren --transform path/to/MyTransform.js
(function(issue) {
  // Add/edit our new field.
  issue.issue_id = issue.id;

  // Delete the old field
  delete issue.id;

  // Return the modified issue.
  return issue;
});

When a transform, one or more, is provided, each issue is run through the transform before it goes through the output method, another type of transform! Currently, only synchronous transforms are supported.