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

siegem

v1.1.0

Published

SIEGE iMproved

Downloads

3

Readme

SIEGE iMproved

A mostly API-compatible node implementation of the fantastic siege command-line utility for benchmarking and stress testing servers. Improvements include enhanced granularity for request timing, simplified POST/PUT/DELETE usage (inspired by curl), and easy-to-use programmatic API.

Installation

$ npm install -g siegem

Usage

$ siegem --help

Examples

Quick Benchmark

Continuously hit /ping with 100 concurrent users 100 times each (will request 10000 times and then stop).

$ siegem -c 100 -d0 -r 100 http://localhost:3000/ping

Long Benchmark

For 15 minutes, hit /test with 50 concurrent users that wait up to 5 seconds before requesting again.

$ siegem -c 50 -d 5000 -t 15m http://localhost:3000/test

PUT Some Data

$ siegem -c 5 -X PUT -H 'Content-Type: application/json' --data '{"foo": "bar"}' http://localhost:3000/something

POST A Lot of Data

$ siegem -c 5 -X POST -H 'Content-Type: application/json' --data @my_file.json http://localhost:3000/something

Hammer Lots of Endpoints

$ siegem -c 100 --chaotic --file my_urls.txt

my_urls.txt

http://google.com/
http://facebook.com/
-X HEAD http://twitter.com/
-X HEAD http://yahoo.com/
-X POST -H 'if-none-match: etag123' http://mysite.com/foo
-X DELETE http://mysite.com/other-stuff
-X PUT -H 'content-type: application/json' --data @/var/stuff/my_stuff/data.json http://mysite.com/lots-of-data

POST Data with Dependencies

$ siegem --file my_urls.txt

my_urls.txt

  1. Label a URL's response by prefixing the line with a variable name beginning with $. ($msg in the example below)
  2. In a later line, reference a previous response using %%<name><specifier>%%.
    1. @<property> - Specify a JSON property path.
    2. /<regex> - Specify a regex to extract.
$msg -X POST --data '{"message": "foo"}' http://localhost:3000/messages
-X GET 'http://localhost:3000/messages/%%msg@id%%'
-X PUT --data '{"message": "%%msg/.*%%"}' 'http://localhost:3000/messages/%%msg@id%%'