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

persistent-log

v1.1.0

Published

this is a simple demo of an append-only log with writes committed to disk

Downloads

1

Readme

persistent-log

this is a simple demo of an append-only log with writes committed to disk. it is meant to be used in development in place of something more robust, like kafka. please don't use this in anything close to a production environment.

example: LogService

$ npm run start:example:service
$ curl -X POST -H 'content-type: application/json' localhost:9977/ -d '{"hi": 1}' -v

*   Trying ::1...
* Connected to localhost (::1) port 9977 (#0)
> POST / HTTP/1.1
> Host: localhost:9977
> User-Agent: curl/7.43.0
> Accept: */*
> content-type: application/json
> Content-Length: 9
>
* upload completely sent off: 9 out of 9 bytes
< HTTP/1.1 201 Created
< X-Powered-By: Express
< Content-Type: application/json; charset=utf-8
< Content-Length: 64
< ETag: W/"40-qpDxi75u8g5HJ8fQPeX62w"
< Date: Wed, 21 Dec 2016 12:03:58 GMT
< Connection: keep-alive
<
* Connection #0 to host localhost left intact
{"offset":"58MiJffLSHP9EshHZ1Y9Nk79nd3mTczfqn7t8BPyLWk5yq1dRx8"}

$ curl localhost:9977/tail -v
*   Trying ::1...
* Connected to localhost (::1) port 9977 (#0)
> GET /tail HTTP/1.1
> Host: localhost:9977
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Date: Wed, 21 Dec 2016 12:15:26 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
{"offset":"2suEo7QKG2FT5xu4btqHtEPUTD4tsjantUdBLkngtDJ","obj":{"hi":1}}
{"offset":"2suEo7QKG2FT5xu4btqHtEPUTD4tsjantUdBLkngtu2","obj":{"hi":1}}
{"offset":"9HfZtXFubJWn8uinu1n9X86CAgGBxvx9YCvgeCGf3HXa","obj":{"hi":1}}
{"offset":"9HfZtXFubJWn8uinu1n9X86CAgGBxvx9YCvgeCGf3cw6","obj":{"hi":1}}
{"offset":"9HfZtXFubJWn8uinu1n9X86CAgGBxvx9YCvgeCGf3xLc","obj":{"hi":1}}
^C

$ curl 127.0.0.1:9977/truncate -X POST -v
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 9977 (#0)
> POST /truncate HTTP/1.1
> Host: 127.0.0.1:9977
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Date: Wed, 21 Dec 2016 12:15:54 GMT
< Connection: keep-alive
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact

$ curl localhost:9977/tail?from=3nT7F6WwLbfqxMBcPGXUPzpSJfC6b5u6mB4GwVxHZLUiZgp -v
*   Trying ::1...
* Connected to localhost (::1) port 9977 (#0)
> GET /tail?from=3nT7F6WwLbfqxMBcPGXUPzpSJfC6b5u6mB4GwVxHZLUiZgp HTTP/1.1
> Host: localhost:9977
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Date: Wed, 21 Dec 2016 12:29:00 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
{"offset":"3nT7F6WwLbfqxMBcPGXUPzpSJfC6b5u6mB4GwVxHZLUiZgp","obj":{"hi":3}}

readme updates to come