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

satnames

v0.0.1

Published

Derive the name from Bitcoin ordinal numbers. Additionally, it provides the capability to search for specific patterns in UTXOs within a specified range.

Downloads

2

Readme

CircleCI

Ordinals Sat Name Finder

This module allows you to derive the satellite name from ordinal satellite numbers. Additionally, it provides the ability to search for specific patterns in UTXOs within a given range.

Table of Contents

Quickstart

node

npm init -y
npm i satnames

index.mjs

import { SatNames } from 'satnames'

const satNames = new SatNames()
satNames.init()
const number = '1953186218210490'
const satName = satNames
    .toSatName( { 'satNumber': number } )
    .getSatName()

console.log( `Check out the sleepiest sat: ${satName}`)

.toSatName( {...} )

| Option | Description | Type | Required | |--------------|---------------------------------------------------------|--------|----------| | satNumber | The satellite number for which you want to get the name | string | true |

Examples:

satNames
    .toSatName( { 'satNumber': '123' } )
    .getSatName()
import { SatNames } from 'satnames'

const satNames = new SatNames()
const result = satNames
    .init()
    .toSatName( { 'satNumber': '1953186218210490' } )
    .getSatName()

console.log( 'result', result )

.toSatNumber( {...} )

| Option | Description | Type | Required | |----------|---------------------------------------------------|--------|----------| | satName | The satellite name for which you want to get the number | string | true |

Examples:

satNames
    .toSatNumber( { 'satNumber': '123' } )
    .getSatNUmber()
import { SatNames } from 'satnames'

const satNames = new SatNames()
const result = satNames
    .init()
    .toSatNumber( { 'satName': 'zzzzzzzzzz' } )
    .getSatNumber()

console.log( 'result', result )

.setSimplePattern( {...} )

| Option | Description | Type | Required | |----------|----------------------------------------------------|--------|----------| | pattern | The pattern or regular expression to search for | string | true |

With the .setSimplePattern( { 'pattern': 'abc' } ) method, you can easily perform searches. Since the search is performed using a regular expression, you can also input regex patterns like /abc/.

The following example checks whether the "sleepiest" ordinal has been found.

import { SatNames } from 'satnames'

const satNames = new SatNames()
satNames
    .init()
    .setSimplePattern( { 'pattern': 'zzzzzzzzzz' } )

const result = satNames
    .toSatName( { 'satNumber': '1953186218210490' } )
    .getPatternsForSatName()

console.log( 'result', result )

.setCustomPattern( { 'challenges': [ {...} ] )

Overview

Methods The following pattern methods are available:

| Method | Description | Options | |---------------------|--------------------------------------------------|-----------------------------| | inSuccession| Search for patterns in succession | { 'startsWith' }, { 'endsWith' } | | regularExpression | Search using regular expressions |no options needed |

Logic Under expect, you need to specify a logic, and the following cases are available for this purpose. Use value to set the value against which the result is checked.

| Case | Description | |----------|----------------------------------------| | = | Check if zeros is equal to value | | > | Check if zeros is greater than value | | >= | Check if zeros is greater than or equal to value | | < | Check if zeros is less than value | | <= | Check if zeros is less than or equal to value | | Default | Display an error message if the logic is not recognized |

Example

You can add as many challenges as you like using .setCustomPattern( { 'challenges': [ {...} ] }. For this purpose, there are the methods inSuccession with the options startsWith and endsWith, or regularExpression, where no option is needed.

In the following example, a search is performed for names that start with more than 2 'a's at the beginning and end with 2 'a's. The second search looks for names that contain the letter sequence "abcdef" within them.

import { SatNames } from 'satnames'

const satNames = new SatNames()
satNames
    .init()
    .setCustomPattern( { 
        'challenges': [
            {
                'name': 'more a',
                'logic': [
                    {
                        'method': 'inSuccession',
                        'option': 'startsWith',
                        'value': 'a',
                        'expect': {
                            'logic': '>',
                            'value': 2
                        }
                    }
                    ,{
                        'method': 'inSuccession',
                        'option': 'endsWith',
                        'value': 'a',
                        'expect': {
                            'logic': '=',
                            'value': 2
                        }
                    }

                ]
            },
            {
                'name': 'myRegex',
                'logic': [
                    {
                        'method': 'regularExpression',
                        'value': 'abcdef',
                        'expect': {
                            'logic': '=',
                            'value': true
                        }
                    }
                ]
            }
        ] 
    } )

satNames
    .toSatName( { 'satNumber': '1953186218210490' } )
    .getPatternsForSatName()

console.log( 'result', result )

.getPatternsForSatRange( {...} )

| Option | Description | Type | Required | |---------|----------------------------------------------------------|--------|----------| | from | The starting satellite number | string | true | | to | The ending satellite number | string | true |

satNames
    .init()
    .setSimplePattern( { 'pattern': 'zzzzzzzzzz' } )
    .getPatternsForSatRange( { 'from': '123', 'to': '134' } )
import { SatNames } from 'satnames'

const satNames = new SatNames()
satNames
    .init()
    .setSimplePattern( { 'pattern': 'zzzzzzzzzz' } )

const results = satNames
    .checkPatternsForSatRange( { 'from': 10, 'to': 130 } )

console.log( 'results', results )

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/satNames. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Limitations

  • Currently in Alpha Stage

Credits

  • Inspired by Erin´s sleepiest tweet: https://twitter.com/realizingerin/status/1720485880631324936
  • Bob Bodily, PhD tweet: https://twitter.com/BobBodily/status/1720496786513784947

License

The module is available as open source under the terms of the MIT.

Code of Conduct

Everyone interacting in the EasyMina project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.