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

microcrawler-worker

v0.0.18

Published

Microcrawler Worker

Downloads

4

Readme

Microcrawler Worker

Status

Build Status License Dependency Status

Prerequisities

Getting started

Clone Sources

git clone https://github.com/AplloCrawler/microcrawler-worker.git

Enter Directory with Sources

cd microcrawler-worker

Install Dependencies

npm install

Run Microcrawler Worker

bin/microcrawler-worker.js

Usage

Show Help

$ ./bin/microcrawler-worker.js -h

  Usage: microcrawler-worker [options]

  Options:

    -h, --help                           output usage information
    -V, --version                        output the version number
    -c, --channel <CHANNEL>              Channel to connect to, default: worker:lobby
    --heartbeat-interval <MILLISECONDS>  Heartbeat interval in milliseconds, default: 10000
    -i, --interactive                    Run interactive mode
    -u, --url <URL>                      URL to connect to, default: ws://localhost:4000/socket
    -t, --token <TOKEN>                  Token used for authorization, default: null

Print Version

$ ./bin/microcrawler-worker.js --version
0.0.1

Connect to Default URL

$ ./bin/microcrawler-worker.js
Connecting to "ws://localhost:4000/socket"

Connect to Custom URL

$ ./bin/microcrawler-worker.js -u ws://example.com/socket
Connecting to "ws://example.com/socket"

Sample Output

$ ./bin/microcrawler-worker.js --heartbeat-interval 10000
Connecting to "ws://localhost:4000/socket"
Received ok
{
    "msg": "Welcome!"
}
Received event - pong
{
    "version": "0.0.1",
    "os": {
        "uptime": 139871,
        "platform": "darwin",
        "mem": {
            "total": 8589934592,
            "free": 134340608
        },
        "load": [
            2.14794921875,
            2.11328125,
            2.318359375
        ],
        "hostname": "kx-mac.local",
        "endian": "LE",
        "cpus": [
            {
                "times": {
                    "user": 17079150,
                    "sys": 8949760,
                    "nice": 0,
                    "irq": 0,
                    "idle": 65412150
                },
                "speed": 1700,
                "model": "Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz"
            },
            {
                "times": {
                    "user": 7933380,
                    "sys": 3558830,
                    "nice": 0,
                    "irq": 0,
                    "idle": 79947730
                },
                "speed": 1700,
                "model": "Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz"
            },
            {
                "times": {
                    "user": 17069960,
                    "sys": 7510340,
                    "nice": 0,
                    "irq": 0,
                    "idle": 66859640
                },
                "speed": 1700,
                "model": "Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz"
            },
            {
                "times": {
                    "user": 8092410,
                    "sys": 3646170,
                    "nice": 0,
                    "irq": 0,
                    "idle": 79701350
                },
                "speed": 1700,
                "model": "Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz"
            }
        ]
    },
    "name": "microcrawler-worker",
    "msg": "I am still alive!",
    "id": 0,
    "ts": 1475360236777
}

Interactive Mode

Server

$ iex -S mix phoenix.server
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

[info] Running MicrocrawlerWebapp.Endpoint with Cowboy using http://localhost:4000
Interactive Elixir (1.3.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 05 Oct 20:54:35 - info: compiled 6 files into 2 files, copied 6 in 1.6 sec
[info] JOIN worker:lobby to MicrocrawlerWebapp.WorkerChannel
  Transport:  Phoenix.Transports.WebSocket
  Parameters: %{"token" => nil}
Received join - worker:lobby
{
  "token": null
}
#PID<0.366.0>
[info] Replied worker:lobby :ok
{:basic_consume_ok, %{consumer_tag: "amq.ctag-Rb-fiGVc4xTncGoOKjxyKA"}}
#PID<0.366.0>
Received event - msg
{
  "msg": "Hello World!"
}
Received event - msg
"Hi, how are you?"
Received event - msg
"Received my message?"
Received event - msg
42
Received event - msg
{
  "abc": "123"
}
Received event - msg
{
  "pole": [
    1,
    2,
    3,
    4
  ],
  "msg": "to pole je fakt urodny"
}
{:shutdown, :closed}
#PID<0.366.0>
%Phoenix.Socket{assigns: %{rabb_chan: %AMQP.Channel{conn: %AMQP.Connection{pid: #PID<0.369.0>},
    pid: #PID<0.379.0>}, rabb_conn: %AMQP.Connection{pid: #PID<0.369.0>}},
 channel: MicrocrawlerWebapp.WorkerChannel, channel_pid: #PID<0.366.0>,
 endpoint: MicrocrawlerWebapp.Endpoint, handler: MicrocrawlerWebapp.UserSocket,
 id: nil, joined: true, pubsub_server: MicrocrawlerWebapp.PubSub, ref: nil,
 serializer: Phoenix.Transports.WebSocketSerializer, topic: "worker:lobby",
 transport: Phoenix.Transports.WebSocket, transport_name: :websocket,
 transport_pid: #PID<0.364.0>}

Client

$ ./bin/microcrawler-worker.js -i --heartbeat-interval 3600000
Connecting to "ws://localhost:4000/socket"
Running in interactive mode.
Type "quit" or press ctrl+c twice to exit.
msg> Received ok
{
    "msg": "Welcome!"
}
msg> Hi, how are you?
msg> Received my message?
msg> 42
msg> {"abc": "123"}
msg> {"pole": [1, 2, 3, 4], "msg": "to pole je fakt urodny"}
msg> quit
$