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

recink-comment

v1.0.5

Published

REciNK Component for Comment

Downloads

4

Readme

REciNK Component for commenting things

This is a REciNK component that submits comments to different backends.

Prerequisites

  • [x] Git >= v1.x
  • [x] Node.js >= v6.x
  • [x] NPM >= v3.x
  • [x] REciNK

Use nvm to install and manage different versions of Node.js; Ideally, use v8+ for faster performance

Installation

  • npm install -g recink-comment

Note that the component is installed automatically when running recink component add comment

Configuration

.recink.yml configuration:

$:
  preprocess:
    '$.comment.providers.github.0.token': 'eval'
    # '$.comment.listen': 'eval'
  comment:
    # listen: '`${ process.cwd() }/recink.comment`'     # Listen for file input (including initial content; think "tail -f")
    providers:                                          # Supported providers: github
      github:
        - token: 'process.env.GITHUB_TOKEN'

.travis.yml configuration:

script: 'recink run unit -c recink-comment'  
before_install:
  # other before_install scripts...
  - 'npm install -g recink-comment'

Or using the registry:

before_install:
  # other before_install scripts...
  - 'recink component add comment'

Add the GITHUB_TOKEN to .travis.yml:

recink travis encrypt -x 'GITHUB_TOKEN=1234'

If you are using Travis Pro read this guide to properly encrypt the environment variable

Usage

GITHUB_TOKEN=1234 recink run unit -c recink-comment

Pushing Messages Using Programatic API

Let's assume you're in a component context (e.g. pagespeed-component.js):

  /**
   * @param {Emitter} emitter
   * 
   * @returns {Promise}
   */
  run(emitter) {
    const commentComponent = emitter.component('comment');

    return commentComponent 
      ? commentComponent.comment(`Hello from ${ Date() }`) 
      : Promise.resolve();
  } 

Pushing Messages to Input Stream

Let's assume that ~/recink.comment is the input stream comment component is listening to:

echo "Test message" >> ~/recink.comment

Note that the initial ~/recink.comment content would be submitted as a single comment.