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/iterator-cascade-callbacks

v1.0.1

Published

JavaScript/TypeScript Iterables with Rust-like ergonomics: `.filter`, `.map`, and more!

Downloads

3

Readme

Iterator Cascade Callbacks

JavaScript/TypeScript Iterables with Rust-like ergonomics: .filter, .map, and more!

Byte size of Iterator Cascade Callbacks Open Issues Open Pull Requests Latest commits Build Status



Requirements

NodeJS development dependencies may be installed via NPM...

npm install

Notice as of version 1.0.0 NodeJS dependencies are for development only, ie. if utilizing this project within other applications or as a Git submodule, then no third-party dependencies are required.


Quick Start

NodeJS projects may use npm to install iterator-cascade-callbacks as a dependency...

npm install @javascript-utilities/iterator-cascade-callbacks

... or as a development dependency via --save-dev command-line flag...

npm install --save-dev @javascript-utilities/iterator-cascade-callbacks

... Check Usage for quick tips on how to import this project within your own source code.

API documentation should be reasonably up-to-date with quick examples, and tips.


Usage

Note; the examples/ directory contains sample projects, which likely will be more instructive than this set of sub-sections.


import code and types as TypeScript module

import { Asynchronous, Synchronous } from '@javascript-utilities/iterator-cascade-callbacks';

import type {
  Asynchronous as Asynchronous_Types,
  Synchronous as Synchronous_Types,
  Shared as Shared_Types
} from '@javascript-utilities/iterator-cascade-callbacks';

require as NodeJS library

const { Asynchronous, Synchronous } = require('@javascript-utilities/iterator-cascade-callbacks');

Synchronous.Iterator_Cascade_Callbacks examples


Asynchronous.Iterator_Cascade_Callbacks examples


Notes

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

At time of writing (late 2023-10-16) it seems TypeScript will not fully parse exports from the package.json file, so while this project does publish features as self contained files, TypeScript consumers will need to import or require from the related index file.

However, those that are authoring pure JavaScript projects may make use of target/feature specific transpiled files; asynchronous.mjs, asynchronous.js, synchronous.mjs, and/or synchronous.js instead. Which should reduce network/system overhead for applications that require only a sub-set of features offered by the Iterator Cascade Callbacks library.


Common issues and possible fixes

Could not find a declaration file for module

Error message example

src/index.ts:3:30 - error TS7016: Could not find a declaration file for module '@javascript-utilities/iterator-cascade-callbacks'. '...' implicitly has an 'any' type.

Try `npm i --save-dev @types/iterator-cascade-callbacks` if it exists or add a new declaration (.d.ts) file containing `declare module '@javascript-utilities/iterator-cascade-callbacks';`

3 import { Asynchronous } from '@javascript-utilities/iterator-cascade-callbacks';
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Possible fix define --moduleResolution as either node16 or nodenext

tsconfig.json (snip)

{
  "compilerOptions": {
    "moduleResolution": "NodeNext",
    "...": "..."
  }
}

Contributing

Options for contributing to Iterator Cascade Callbacks and JavaScript Utilities


Forking

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

cd ~/git/hub/javascript-utilities/iterator-cascade-callbacks

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


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 iterator-cascade-callbacks 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

Iterator that chains callback function execution
Copyright (C) 2023 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.