Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

escapist-middleware

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escapist-middleware

Ignore certain files so they are not served

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
2
Weekly downloads
 
Created
Source

Escapist Middleware

npm tests dependencies

Making trapdoors for secret files since 1748.

Note: This project is in early development, and versioning is a little different. Read this for more details.

Why should you care?

So you are serving a static site. You know, the usual. But you've got some files in your project you don't want to be publicly available. At the same time you don't want to have to remove them from your project. Escapist to the rescue!

Installation

npm install escapist-middleware

Usage

Escapist is pretty easy to use. You can feed it a string or array of string with paths to the files you'd like to prevent from being served. You can even use globstars, a la minimatch! Quick example:

var http = require('http'),
    connect = require('connect'),
    escapist = require('escapist-middleware');

var app = connect()
            .use(escapist('path/to/secret.txt'))
            .use(connect.static('public'));

http.createServer(app).listen(1111);

Also, as noted, you can pass an array of string and use globstars, like this:

escapist(['**/keys/id_rsa', 'plaintext_passwords/*'])

Note: We do not endorse keeping ssh private keys and/or plaintext passwords in your repos.

Escapist does not actually serve files, so it's not a standalone solution. It should be used as part of a larger stack. For an example of an awesome static stack, check out charge.

License & Contributing

FAQs

Package last updated on 12 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc