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

botd

v1.0.5

Published

run code in the slack

Downloads

41

Readme

BotD - Dev, Daemon and Automation, All in Slack.

Build Status

BotD start a daemon process in server side, and connect to your Slack. When code submit, the process will run it and output will be piped to your slack.

Write, run and debug nodejs code, when good enough, make a cron job to do automation. The whole process is in slack.

BotD can be used to:

Show team the runnable code, not words;
Share team the code and results;
"Codepen" for Team;
Operate in server side;
Hire talent by coding in slack.

Demo: Hello, World

The follow gif shows how to invite BotD, write and execute the code, change and rerun the code: hello,world

Start

node ./botd.js -t  <slack bot token> -n <bot name, optional>

API

First, git clone botd or npm install botd.

Second (optional), configure packages/libs for Shell script runtime:

var Shell = require('botd').Shell;
Shell.addLibs("request", "superagent"); // install superagent in your project
Shell.addLibs("format", `${__dirname}/libs/format`); // `format` is your my own lib
// then in your shell script, format and request are imported.

Third, start bot:

var SlackBot = require('botd').SlackBot;
var Connector = require('botd').Connector;
var slack = new SlackBot("<bot token>", "<bot name>");
var connector = new Connector(slack);
slack.startBot();

Your bot should be shown in your slack im list!

Find FAQ in FAQ

Security Issues

As default, the running scripts are given secure enough packages (co, lodash etc).
Maybe you have added "dangerous" package( e.g. fs, child_process - crazy rm -fr / :(, even network), here are some suggestions:

start botd running as a limited user (no root please).
use cgroup to limit the cpu privilege lower.

YOU NEED UNDERSTAND WHAT ARE YOU DOING WHEN HOST BOTD IN YOUR PRODCUTION SERVER!

Storage

For now, BotD support two storage types: file(default) and mongodb(optional).

stored by file

Default, use current dir where generate two json file (./channels.json & ./apps.json) as db file:

node ./botd.js -t <bot token> -name <bot name>

Use specified dir and generate json file: /path/to/dir/channels.json and /path/to/dir/apps.json:

DB=file:/path/to/dir node ./botd.js -t <bot token> -name <bot name>

Make sure the dir exist and writable.

stored by mongodb

Set the process env DB and start it:

DB=mongodb://localhost/botd node ./botd.js -t  <slack bot token>

SaaS use mongodb to store your data.

Samples

For app development, you can find a sample project Hacker News Bot, There are several apps:

Follow - to follow Hacker News keyword, items or users, make HN like a twitter.
Checker - check if a link is submitted in HN automatically.
Agent - after bind a HN id, get notification when someone comment/upvote my HN items, or when someone reply my comments.

For shell scripts, you can find example gist in https://gist.github.com/datalet/public

FAQ

Find FAQ here.

Contact

Welcome to fire issues in github, or send pull request, or use SaaS to make life easy.