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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ya-syn

v1.7.0

Published

Yet Another Synchronizer for TypeScript.

Readme

ya-syn

CodeQL Security Audit npm version License: MIT

Yet Another Synchronizer for TypeScript.

  • Promise based synchronization
  • Concurrency setting to support lock(n==1) and semaphore(n>1)
  • Reentrant synchronization (nodejs only at this point)
  • Timeout
  • Throttling
  • Bucket based flow control (Token Bucket / Leaky Bucket)
  • Logging

stateDiagram-v2
    direction LR
    [*] --> Acquire
    [*] --> Throttle
    Acquire --> Timeout
    Acquire --> Acquired
    state Synchronized {
        Acquired --> Release
        state Reenter {
            direction LR
            Enter --> Exit
        }
    }
    Release --> Finish
    [*] --> Enter
    Exit --> Finish
    Finish --> [*]

How to install

npm install ya-syn

Security

This project uses automated security scanning:

  • CodeQL Analysis: Static code analysis for security vulnerabilities
  • Dependabot: Automated dependency updates and vulnerability alerts
  • npm audit: Regular security audits of production dependencies

Current status: CodeQL Security Audit

Documentation

For detailed architecture, usage examples, and API documentation, please visit our Wiki:

The wiki includes:

  • Architecture Overview: Core Semaphore, Semaphore, Synchronizer design patterns
  • SynchronizerProvider: Factory pattern for managing synchronizers with forKey() and forObject()
  • Synchronizer: High-level interface with timeout, throttle, event monitoring, and statistics
  • LazyInitializer: Async singleton pattern with reentrancy detection
  • CachedProvider: TTL-based async cache with Double-Check Locking pattern
  • WeakIndexMap: Weak reference map for managing objects by parameters
  • TaskExecutor: Async generator-based task processing with concurrency control
  • Practical Examples: API rate limiting, database connection pools, batch processing, and more

Version History

  • 1.7.0
    • Add Bucket based flow control (TokenBucket / LeakyBucket) for TaskExecutor
  • 1.6.0
    • Add WeakIndexMap
  • 1.5.0
    • Add Process Monitor
  • 1.4.2
    • Fix bug in waitCompleteAll
  • 1.4.1
    • Fix resource leak in reentrant check
  • 1.4.0
    • Add waitComplete/waitCompleteAll handlers to CoreSemaphore
    • Restructure task executor by replace Synchronizer with CoreSemaphore
  • 1.3.4
    • Update Core Semaphore method signature
  • 1.3.3
    • Expose Core Semaphore
  • 1.3.2
    • Reduce memory usage
  • 1.3.1
    • Add eager option to LazyInitializer
    • Fix bug that executor doesn't wait until all tasks completes
  • 1.3.0
    • Add mergeAsyncGenerators to enhance task executor
  • 1.2.0
    • Added Task Executor
  • 1.1.2
    • Use weak ref for string key based synchronizer provider
    • Set default provider/synchronizer/execution id to uuid
  • 1.1.1
    • Fix bug in handling reenter with throttling
  • 1.1.0
    • Add capture utility method to CachedProvider(#5)
    • Add reentrant entry detector to LazyInitializer(#3)
  • 1.0.1
    • Fix event handling leak
  • 1.0.0
    • Initial Release

Next Step

  • Support reentrant synchronization on web browser

License

This project is under the MIT license. Copyright (c) 2024 Tomohisa Ota