npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

metalsmith-htaccess

v2.0.1

Published

A Metalsmith plugin to create an htaccess configuration file.

Downloads

13

Readme

metalsmith-htaccess

npm: version npm: downloads

Snyk: vulnerabilities codecov: coverage license

A Metalsmith plugin to create an Apache HTTP Server .htaccess configuration file.

Installation

npm install --save metalsmith-htaccess

JavaScript Usage

const Metalsmith = require('metalsmith');
const htaccess   = require('metalsmith-htaccess');

Metalsmith(__dirname)
    .use(htaccess({
        // options here
    }))
    .build((err) => {
        if (err) {
            throw err;
        }
    });

Options

Core

core.defaultCharset (optional)

Type: string Default: "utf-8"

Sets AddDefaultCharset.

core.serverSignature (optional)

Type: boolean Default: false

Enables or disables ServerSignature.

core.errorDocuments (optional)

Type: object

An object of ErrorDocuments, example:

{
  "core": {
    "errorDocuments": {
      "401": "/error_pages/401.html",
      "404": "/error_pages/404.html",
      "500": "/error_pages/500.html"
    }
  }
}

Core Options

core.options.followSymlinks (optional)

Type: boolean Default: true

Enables or disables FollowSymlinks.

core.options.indexes (optional)

Type: boolean Default: false

Enables or disables Indexes.

core.options.multiViews (optional)

Type: boolean Default: false

Enables or disables MultiViews.

Deflate

deflate.mimeTypes (optional)

Type: string[] Default: ["image/svg+xml", "application/javascript", "application/rss+xml", "application/vnd.ms-fontobject", "application/x-font", "application/x-font-opentype", "application/x-font-otf", "application/x-font-truetype", "application/x-font-ttf", "application/x-javascript", "application/xhtml+xml", "application/xml", "font/opentype", "font/otf", "font/ttf", "image/x-icon", "text/css", "text/html", "text/javascript", "text/plain", "text/xml"]

A list of MIME types to AddOutputFilterByType DEFLATE.

Dir

dir.index (optional)

Type: string Default: "index.html index.htm index.php index.cgi"

Set DirectoryIndex.

Environment

environment.serverAdminEmail (optional)

Type: string

Set SetEnv SERVER_ADMIN.

environment.timezone (optional)

Type: string

Set SetEnv TZ.

Expires

expires.default (optional)

Type: string Default: "access plus 2 days"

Set ExpiresDefault.

expires.types (optional)

Type: object Default:

{
    "image/jpg": "access plus 1 month",
    "image/svg+xml": "access 1 month",
    "image/gif": "access plus 1 month",
    "image/jpeg": "access plus 1 month",
    "image/png": "access plus 1 month",
    "text/css": "access plus 1 month",
    "text/javascript": "access plus 1 month",
    "application/javascript": "access plus 1 month",
    "application/x-shockwave-flash": "access plus 1 month",
    "image/ico": "access plus 1 month",
    "image/x-icon": "access plus 1 month",
    "text/html": "access plus 600 seconds"
}

Set ExpiresByType.

Gzip

gzip.canNegotiate (optional)

Type: boolean

Enables or disables mod_gzip_can_negotiate.

gzip.dechunk (optional)

Type: boolean

Enables or disables mod_gzip_dechunk.

gzip.include (optional)

Type: string[]

A list of mod_gzip_item_include.

gzip.exclude (optional)

Type: string[]

A list of mod_gzip_item_exclude.

Headers

headers.etag (optional)

Type: boolean Default: false

Enables or disables ETag header.

MIME

mime.defaultLanguage (optional)

Type: string

Sets DefaultLanguage.

mime.languages (optional)

Type: object

An object of AddLanguages, example:

{
    "mime": {
        "languages": {
            "en": "en",
            "en-gb": ".en",
            "en-us": ".en"
        }
    }
}

mime.charsets (optional)

Type: object

An object of AddCharsets, example:

{
    "mime": {
        "charsets": {
            "EUC-JP": ".euc",
            "ISO-2022-JP": ".jis",
            "SHIFT_JIS": ".sjis"
        }
    }
}

mime.types (optional)

Type: object

An object of AddTypes, example:

{
    "mime": {
        "types": {
            "image/gif": ".gif",
            "image/jpeg": "jpeg jpg jpe"
        }
    }
}

Rewrite

rewrite.404 (optional)

Type: string

Sets the 404 redirect page.

rewrite.options (optional)

Type: string Default: "Inherit"

Sets RewriteOptions.

rewrite.allowedMethods (optional)

Type: string[]

A list of allowed HTTP methods.

rewrite.httpsRedirect (optional)

Type: boolean

Enable HTTPS redirection.

Spelling

spelling.check (optional)

Type: boolean

Enables or disables CheckSpelling.

Changelog

Changelog