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

getprofile

v0.0.19

Published

getprofile

Downloads

15

Readme



GitHub license npm npm Github Stars

Nostr Event Fetcher

This is a simple utility that subscribes to a Nostr relay, fetches events of specified kinds, and stores the parsed results in a JSON file.

Features

  • Fetches and parses events from Nostr network
  • Writes the fetched data into a JSON file
  • Allows specifying event kinds to filter the events
  • Supports caching of fetched data for later use

Usage

  1. Clone the repository:
git clone https://github.com/nostrapps/getprofile.git
cd yourrepository
  1. Install the dependencies:
npm install
  1. Run the script:
node index.js

By default, the script uses 'de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645' as the user. If you want to use a different user, pass the user's public key as a command line argument:

node index.js <pubkey> <relay>

This will create a new directory under the ./cache directory named after the user's public key, and a JSON file named index.json in this directory. The JSON file will contain the parsed data from the fetched events.

Data Structure

The JSON file will have the following structure:

{
  '@context': 'https://w3id.org/nostr/context',
  '@type': 'Profile',
  '@id': 'nostr:pubkey:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645',
  mainEntityOfPage: '',
  name: 'melvincarvalho',
  image: 'https://void.cat/d/Eon6A2onyvTWGSseNkwQ4v.webp',
  description: 'Mathematician and Web Developer',
  picture: 'https://void.cat/d/Eon6A2onyvTWGSseNkwQ4v.webp',
  website: 'https://melvincarvalho.com/',
  nip05: '[email protected]',
  about: 'Mathematician and Web Developer',
  banner: 'https://void.cat/d/KhHoehWtdyXFjmDh1NxKWZ',
  display_name: 'Melvin Carvalho',
  lud16: '[email protected]',
  lud06: 'LNURL1DP68GURN8GHJ7MR9VAJKUEPWD3HXY6T5WVHXXMMD9AKXUATJD3CZ7ET9XFVR25S5W7VAN',
  displayName: 'Melvin Carvalho',
  pubkey: 'de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645',
  npub: 'npub1melv683fw6n2mvhl5h6dhqd8mqfv3wmxnz4qph83ua4dk4006ezsrt5c24',
  created_at: 1699085316
}

Dependencies

This utility uses the following npm packages:

  • nostr: This is the main package that is used to communicate with the Nostr network.
  • fs: This package is used to write the parsed data into a JSON file.
  • path: This package is used to handle file and directory paths.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Contact

If you have any questions or issues, please open an issue on this repository.