Meteor Package Server Sync
A client for Meteor Package Server API.
Creates and syncs all data about packages to local MongoDB collections and keeps them in sync.
Code Quality
This project has been setup with eslint, prettier and editorconfig configurations to ensure clean, consistent, error free code.
Installation
meteor add peerlibrary:meteor-packages
Usage
On the server-side, you initialize it like this:
1import { Meteor } from "meteor/meteor"; 2import { PackageServer } from "meteor/peerlibrary:meteor-packages"; 3 4Meteor.startup(function() { 5 PackageServer.startSyncing({ 6 //options - the following are the defaults if not passed 7 logging: false, // When true, informational log messages will be printed to the console 8 sync: { 9 builds: true, // Should information about package builds be stored 10 releases: true, // Should information about Meteor releases and release tracks be stored 11 stats: true, // Should package stats be fetched and stored 12 } 13 }); 14});
Initial syncing might take quite some time.
Then you can access collections:
PackageServer.PackagesPackageServer.VersionsPackageServer.BuildsPackageServer.ReleaseTracksPackageServer.ReleaseVersionsPackageServer.LatestPackagesPackageServer.stats
LatestPackagescollection is the same asVersions, only that it contains only the latest versions of packages.
Schema of documents is the same as described in the documentation with a couple exceptions.
Versionscollection'sdependenciesfield is represented as an array of objects where package
name is stored as packageName key. This is to support package names with . in the name without any problems.
- 
Packagescollection will contain 2 additional fields,directAdds, andtotalAddswhich are the direct and total install counts for the corresponding package. - 
Statscollection adds the date field to the document for ease of querying chronologically.