# nfect

> The Node.js Front-End Construction Toolkit (NFECT) is a Node.js module for simple file output to HTTP clients.

Latest version **0.0.3** (published 2015-10-11) · GPLv3 license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-10-11 |
| First published | 2014-11-30 |
| Weekly downloads | 0 |
| License | GPLv3 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | curtis zimmerman |
| Maintainers | curtiszimmerman |
| Keywords | node, client, file, handle, process |

## Links

- npm: https://www.npmjs.com/package/nfect
- Repository: https://github.com/curtiszimmerman/nfect
- Homepage: https://github.com/curtiszimmerman/nfect#readme
- Issues: https://github.com/curtiszimmerman/node-api-template/issues
- npm.io page: https://npm.io/package/nfect

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2015-10-11
- 0.0.1 — 2014-11-30

## README

NFECT
====
## (Node.js Front-End Construction Toolkit)

NFECT is a Node.js module for simple file output to the client. It uses 
JavaScript method chaining to indicate loading, execution, and 
code-inclusion details for external file and source code dependencies. 
The vision is to provide a mechanism for front-end developers to easily 
incorporate many dependencies (such as common header and footer HTML files, 
CSS files, and client-side JavaScript files) without needing to learn and 
use special content markup or awkward design patterns. NFECT also allows 
a developer to safely pass data via the descriptor object to and between 
each of these dependencies.

## Usage

## Examples

The following Node.js code initializes a simple HTTP server that responds 
to all requests using NFECT to output an `index.html` file to the client.

```javascript
var nfect = require('nfect');
var server = http.createServer(function(req, res) {
  nfect.config({
    request: req, response: res
  }).go();
}).listen(80);
```

The following Node.js example initializes an HTTP server that responds to 
requests for `index.html` using NFECT and a single method to build 
a multiple-page server using several different files. The method also 
specifies a custom `Expires` HTTP header for each of the files.

```javascript
var server = http.createServer(function(req, res) {
  nfect.config({
    request: req, response: res
  }).add({
    files: ['index.html','default.css','site.js'],
    header: {
      'Expires': 'Wed, 01 Jan 2015 16:00:00 GMT'
    }
  }).go();
}).listen(80);
```

Below is an NFECT example that constructs an HTTP server which responds to 
requests for `index.html` using NFECT's build utility to combine multiple
independent files into one output file. Compare this functionality to a 
more traditional `include()` function in other languages.

```javascript
var server = http.createServer(function(req, res) {
  nfect.config({
    request: req, response: res
  }).build({
    files: ['header.inc','body.html','footer.inc'],
    match: 'index.html'
  }).go();
}).listen(80);
```

## License

NFECT is (C) 2014 curtis zimmerman and released under GPLv3.

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