updated npm modules
This commit is contained in:
+8
-4
@@ -25,15 +25,19 @@ const sites = [
|
||||
'github.com'
|
||||
];
|
||||
|
||||
const mapper = el => got.head(el).then(res => res.requestUrl);
|
||||
(async () => {
|
||||
const mapper = async site => {
|
||||
const {requestUrl} = await got.head(site);
|
||||
return requestUrl;
|
||||
};
|
||||
|
||||
const result = await pMap(sites, mapper, {concurrency: 2});
|
||||
|
||||
pMap(sites, mapper, {concurrency: 2}).then(result => {
|
||||
console.log(result);
|
||||
//=> ['http://sindresorhus.com/', 'http://ava.li/', 'http://todomvc.com/', 'http://github.com/']
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pMap(input, mapper, [options])
|
||||
|
||||
Reference in New Issue
Block a user