New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

slashify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slashify

Express/Connect middleware to handle trailing slashes with options

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
42
40%
Maintainers
1
Weekly downloads
 
Created
Source

slashify

Express/Connect middleware to handle trailing slashes with options.

Why?

Why another remove trailing slash middleware? Because we wanted options. Like leaving the slash when serving the index file of a directory and custom index file names, etc!

Install

npm install slashify --save

Usage

var express = require('express');
var slashify = require('slashify');

var app = express();

app.use(slashify());

app.listen(3000, function () {
  
});

slashify([options])

  • options
    • root - the root directory. This is mostly used when you have a directory handling turned on and/or have custom index file names. Defaults to ./
    • index - the name of the directory index file. Defaults to index.html.
    • directory - set whether or not you want slashify to leave the trailing slash when serving the index file of a directory. Defaults to true. Set to false to remove the trailing slash for all paths.

Run Tests

npm install
npm test

Keywords

divshot

FAQs

Package last updated on 19 Mar 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