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

batch-remote-list-js

v1.1.0

Published

JQuery plugin for remote list batch processing via ajax

Downloads

12

Readme

Batch Remote List JS

JQuery plugin for remote list batch processing via ajax.

Screenshot of generated form and some processed data:

BatchRemoteList example screenshot

Install via npm

You can install it via npm

npm i batch-remote-list-js

Usage

Insert jQuery

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

Then insert BatchRemoteList js file

<script src="/your/path/to/js/batch-remote-list-js/jquery.batch-remote-list.js"></script>

Add translation file if you need

<script src="/your/path/to/js/batch-remote-list-js/i18n/ru.js"></script>

Place container for the form and configure batch process

<div id="batch-process-container"></div>

<script>
	$("#batch-process-container").BatchRemoteList({
		
		// ajax URL for getting total number of elements
		// you can omit this by directly setting count value, e.g. "total_count: 100"
		// 
		// otherwise expected response is JSON: 
		//    status: bool
		//    count: int
		//    message: string (error message)
		// 
		// id={itemID} param is added to the request (starting item ID) e.g. /ajax/list/count?id=1
		// 
		// e.g. if you use SQL on backend:
		// you should append SQL rule something like "AND table_id >= {itemID}" to get proper items count
		
		ajax_url_count: '/ajax/list/count',
		
		// ajax URL for processing items
		// 
		// id={itemID} param is added to every request (starting item ID) e.g. /ajax/list/item?id=1
		// 
		// again, if you use SQL on backend:
		// script should append SQL rule something like "AND table_id >= {itemID}" to load an item from list
		//
		// expected response is JSON: 
		//    status: bool, 
		//    item: { id: int, whatever_you_like: mixed } (depends on your callbacks settings but it must contain "id"), 
		//    message: string (error message)
		//
		// if everything goes well, response.item.id + 1 is requested as next item
		// this repeats until the whole list is processed or limit is hit (when it's non-zero value)
		// also you can stop the script whenever you like by pressing the stop button
		
		ajax_url_item: '/ajax/list/item',
		
		// configure callbacks
		// default behavior is to print response to console
		callbacks: {

			// called if response JSON response.status is true and response.item is set
			// returned result is appended to result container
			item_process: function(item){
				// for example:
				return '<div class="item">' + 
					'<div class="name">#' + item.id + ' - ' + item.name + ': </div>' + 
					'<div class="status">' + item.some_status + '</div>' + 
				'</div>';
			},
			
			// called if response JSON response.status is false
			// you can use response.message to print error message
			item_error: function(response){
				// for example:
				return '<div class="item err">' + 
					'<div class="name">' + 
						(response.item ? '#' + response.item.id + ' - ' + response.item.name :  'Unknown item') + 
					': </div>' +
					'<span class="item-msg">' + (response.message || 'Unknown error') + '</span>' + 
				'</div>';
			}

		}
	});
</script>

Here is the list of default options you can override via constructor like in example above (for single instance) or via $.BatchRemoteList.setDefaults (applied to all instances)

// default css classes
classes: {
	// you can set your own classes or use css rules to adjust the look
	form: 'bp-form',
	table : 'bp-form-table',
	td_label : 'bp-form-label',
	td_input : 'bp-form-input',
	submit_container: 'bp-form-submit-container',
	result_container: 'bp-result',
	list_container: 'bp-container-list',
	stats_container: 'bp-stats',
	finish_stats: 'bp-finish-stats'
},
// localized messages
messages: {
	start_process : 'Start',
	stop_process : 'Stop',
	start_from_id : 'Start from ID',
	limit_process : 'Limit',
	process_stopped : 'Batch process stopped',
	finish : 'Finish',
	start_time : 'Start time',
	error : 'Error',
	unknown_error : 'Unknown error',
	data_count_empty : 'Data empty (items were not found)',
	data_count_total : 'Items total',
	data_process_left : 'Items left',
	ajax_fail : 'Remote resource failed',
	limit_exceeded : 'Limit exceeded',
	item_not_found : 'Item was not found',
	data_process_success: 'Items done',
	data_process_failed: 'Items failed'
},
// backend URLs
ajax_url_count: '/ajax/batch-remote-list/count',
ajax_url_item:  '/ajax/batch-remote-list/item',
// time in ms to wait before calling another item request (throttle)
request_throttle: 500,
// set "item_process" and "item_error" callbacks
callbacks: {}