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

@javascript-utilities/guarded-set-interval

v0.0.2

Published

Set interval wrapper with re-entry guard

Downloads

5

Readme

Guarded Set Interval

Set interval wrapper with re-entry guard, I.E. if a callback takes longer than defined interval it'll skip execution for a tick or few.

Byte size of Guarded Set Interval Open Issues Open Pull Requests Latest commits GitHub Actions Build Status License



Requirements

NodeJS dependencies may be installed via NPM...

npm install @javascript-utilities/guarded-set-interval

Quick Start

Clone this project...

Linux/MacOS

mkdir -vp ~/git/hub/javascript-utilities

cd ~/git/hub/javascript-utilities

git clone [email protected]:javascript-utilities/guarded-set-interval.git

Usage

import { Guarded_Set_Interval } from '@javascript-utilities/guarded-set-interval';

const shared_state = { callback_count: 0 };

const callback = {
  next: (...args) => {
    console.log('callback args:', args);
    shared_state.count++;
    if (shared_state.count > 3) {
      return { done: true, value: shared_state.count };
    }
    return { done: false, value: shared_state.count };
  }
};

const interval = new Guarded_Set_Interval({
  callback,
  args: ['foo', 'bar'],
  milliseconds: 1000,
  verbose: true,
});

interval.start();

// ... Do other stuff...

interval.stop();

Notes

This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.


Contributing

Options for contributing to guarded-set-interval and javascript-utilities


Forking

:warning: Creating fork(s), submitting contribution(s), publishing derivative work(s), etc. based on this repository will form an agreement to be bound by the use-cased based licensing sub-sections.

I.E. if you choose to contribute to or use this project, you acknowledge and accept these usage based licensing terms will apply to any such works too.

Start making a Fork of this repository to an account that you have write permissions for.

cd ~/git/hub/javascript-utilities/guarded-set-interval

git remote add fork [email protected]:<NAME>/guarded-set-interval.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/javascript-utilities/guarded-set-interval


git commit -F- <<'EOF'
:bug: Fixes #42 Issue


**Edits**


- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF


git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push -u fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Sponsor

Thanks for even considering it!

Via Liberapay you may sponsor__shields_io__liberapay on a repeating basis.

Regardless of if you're able to financially support projects such as guarded-set-interval that javascript-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.


Attribution


License

This project is licensed based on use-case


Commercial and/or proprietary use

If a project is either commercial or (||) proprietary, then please contact the author for pricing and licensing options to make use of code and/or features from this repository.


Non-commercial and FOSS use

If a project is both non-commercial and (&&) published with a license compatible with AGPL-3.0, then it may utilize code from this repository under the following terms.

Set interval wrapper with re-entry guard
Copyright (C) 2024 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

For further details review full length version of AGPL-3.0 License.