Nanoscale Parts Manufacturing

npm

Need private packages and team management tools?Check out npm Orgs. »

for-more

1.0.1 • Public • Published

for-more

npm version Gzip Size Monthly Downloads License: MIT

Multithread Synchronization Loop. Support Promise.

Install

npm install for-more --save
#or 
yarn add for-more

Import

require('for-more')
//or
var forMore = require('for-more')
//or
import 'for-more'
//or
import forMore from 'for-more'

Usage

// forMore([], options, hander, callback)
// [].forMore(options, handler, callback)
// [].forMore(options, handler).then().catch()
// [].forMore(lines, handler).then().catch()
// [].forMore(handler).then().catch()
 
[1, 2, 3].forMore(2, function(item, index, array) {
  return item * 2
})
.then(function(results) {
  console.log(results)
})
// [2, 4, 6]
 
[1, 2, 3].forMore(2, async function(item, index, array) {
  const html = await axios.get('http://www.google.com?q=' + item)
  return html.data
}, function(results) {
  console.log(results)
})
 
[1, 2, 3].forMore({
  lines: 2, // default is 1
  abort: true // default is false
}, async function(item, index, array) {
  const html = await axios.get('http://www.google.com?q=' + item)
  return html.data
}, function(results) {
  console.log(results)
})
 

install

npm i for-more

Downloadsweekly downloads

3

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability