# nowww

> Node.js express middleware for no-www redirection

Latest version **1.2.1** (published 2018-06-15) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install nowww
pnpm add nowww
yarn add nowww
bun add nowww
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-06-15 |
| First published | 2011-09-13 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | AJ ONeal |
| Maintainers | coolaj86 |
| Keywords | nowww, no-www, connect, express, redirct, yes-www |

## Links

- npm: https://www.npmjs.com/package/nowww
- Repository: https://git.coolaj86.com/coolaj86/nowww.js
- Homepage: http://git.coolaj86.com/coolaj86/nowww.js
- npm.io page: https://npm.io/package/nowww

## Dependencies (1)

- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-06-15
- 1.1.4 — 2018-06-15
- 1.1.3 — 2014-10-02
- 1.1.2 — 2012-12-14
- 1.1.1 — 2012-03-08
- 1.1.0 — 2011-09-24
- 1.0.0 — 2011-09-13

## README

nowww
===

Redirects any domain with `www` to the same site without it.

  * `www.foobar3000.com` -> `foobar3000.com`
  * `www.helloworld3000.com` -> `helloworld3000.com`

See [no-www.org][no-www.org] ![no-www.org][no-www.ico]

  [no-www.ico]: http://no-www.org/images/blog-button.gif
  [no-www.org]: http://no-www.org

In short:

  All domains should have a `www` for backwards compatibility with what
early adopters of the internet have come to expect (and ctrl+enter adds it).
However, those domains should redirect to the root of the domain.

  * it means we type four fewer charaters
  * we don't type `http://` anymore, why would we type `www.`?
  * it's what the cool kids do (i.e. github)
  * `ftp`, `irc`, `ssh`, etc all have their own *protocols*. Why should the web also have a prefix?

Installation
===

```bash
npm install nowww
```

Usage
===

```javascript
(function () {
  'use strict';

  var http = require('http')        // (or https / spdy)
    , connect = require('connect')  // or express
    , nowww = require('./')
    , app = connect()
    , server
    ;

  app
    .use(nowww())
    .use(require('serve-static')(__dirname + '/public/'))
    ;

  server = http.createServer();
  server.on('request', app);
  server.listen(3000, function () {
    console.log('Listening on ' + server.address().port);
  });
}());
```

---
_Source: https://npm.io/package/nowww · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
