Use Pecans as a node module
Pecans can be integrated into a Node.JS application as a node module. Using the middleware, you can add custom authentication on downloads or analytics for downloads counts.
Installation
Pecans can be installed as a local dependency using npm
:
Usage
Configuration
cache
: (string) Path to the cache folder, default value is a temprary foldercacheMax
: (int) Max size of the cache (default is 500MB)cacheMaxAge
: (int) Maximum age in ms (default is 1 hour)preFetch
: (boolean) Pre-fetch list of releases at startup (default is true)basePath
: (string) path segment added between the host and the app path to support proxies that rewrite the path without telling express.
GitHub specific configuration:
refreshSecret
: (string) Secret for the GitHub webhook
Hooks
You can bind interceptors (i.e. hooks) to certain asynchronous actions using pecans.before(fn)
and pecans.after(fn)
:
download
: When an user is downloading a versionapi
: when an user is accessing the API
Last updated