node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org ยป


Serves up the content of a local directory to everyone who logs in with an allowed email address.


var makePrivateServer = require('private-static-website')

var options = {


var server = makePrivateServer(options)




  • privateContentPath: the local path with the content to be served to authenticated users
  • transportOptions: transport options to be passed to nodemailer
  • defaultMailOptions: default values for the "e-mail message fields" to be passed to nodemailer
  • getEmailText: a function that takes a login token and returns a string of html to be sent as the login email
  • domain: the domain name that cookies should be set on
  • db (optional): if you would like user's sessions to be persisted, you may pass in a levelup database for them to be stored in

Primarily composed of

  • just-login for email address authentication
  • st for static file serving


  • logging out
  • turn caching back on