-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetAllPackages.js
More file actions
38 lines (31 loc) · 1.29 KB
/
getAllPackages.js
File metadata and controls
38 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var npmpm = require('npm-postgres-mashup');
npmpm.copyTheData({
couchUrl: "https://registry.npmjs.org", // You can use this too: https://skimdb.npmjs.com/registry
postgresHost: 'localhost',
postgresDatabase: 'npm',
postgresUser: 'x21',
postgresPassword: '',
// Optional. Defaults to false
// Use if you want to be console.logged a lot and updated about progress
beNoisy: true,
// Optional. Defaults to false
// Use if you want to remove any npm postgres tables and start fresh
// Otherwise processing will pick up where you left off
emptyPostgres: false,
// Use this to set a version of the database data, useful to keep the data up-to-date, if changed it will start from the beginning.
schemaversion: 017,
// When the number of errors reaches the limit the app will terminate
errorLimit: 2000,
// number of changes we will process at once
parallelLimit: 8,
// fires once caught up
onCatchup: function () {
console.log("all caught up!");
// use this to safetly stop processing the feed
npmpm.stopFeedAndProcessing(function () {
console.log('stopped the feed');
console.log('exiting now');
process.exit(0);
});
}
});