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

bigrest

v2.0.0-rc2

Published

Smart web and restful framework for NodeJS

Downloads

30

Readme

bigrest

NPM Version NPM Downloads

Smart web and restful framework for NodeJS. current core is express.

Installation

$ npm install bigrest

Usage

var bigrest = require('bigrest')

API

listen(port, opts)

Binds and listens for connections on the port.

var path = require('path');
var bigrest = require('../index');

var http = bigrest.listen(18080, {
    basepath: __dirname,
    statics: [{
        urlpath: '/files',
        filepath: path.join(__dirname, 'files')
    }],
    compression: {
        threshold: 16 * 1024
    }
});

XArray(string) was a Array(string) or a Array splited by ",".
XArray(object) was a Array(object) or a Object(object) ",".

Parameter: opts

The options for bigrest framework.

|Key|Type|Default|Description| |---|---|---|---| |debug|boolean|false|debug mode switch| |etag|boolean|false|switch on ETAG generation| |https|Object|undefined|options for HTTPS protocol| |compression|boolean or Object|false|switch or options for compression| |basepath|string|process.cwd()|the base path| |services|XArray(string)|services|the handlers and routers path| |rootwork|function|undefined|the all METHOD handler for '/'| |r404work|function|undefined|the all METHOD handler while response 404| |visitor|function|undefiend|the pre processor the all handler| |viewer|Object(viewer)|undeifned|set html template engine| |limits|Object(limits)|undeifned|the limits for request parse| |statics|XArray(static)|undefiend|set static file engine| |middlewares|Array(function)|[]|the middlewares for express|

https documents https.createServer
compression as options documents compression

Object(viewer)

|Key|Type|Default|Description| |---|---|---|---| |filepath|string|undefined|the template source file path| |render|string or function|undefiend|the template engine| |cache|boolean|opposite with opts.debug|system cache switch|

{
    render: swig.renderFile,
    filepath: path.join(__dirname, "server", "views")
}

Object(limits)

|Key|Type|Default|Description| |---|---|---|---| |bodySize|number|4mb|the request body size| |uploadSize|number|50mb|the maximum size for file upload|

{
    bodySize: 102400,
    uploadSize: 1024000
}

Object(static)

|Key|Type|Default|Description| |---|---|---|---| |urlpath|string|undefined|the url path| |filepath|string|undefined|the static file's file path| |options|Object|undefined|the static options|

options means in the express.static

{
    urlpath: '/static',
    filepath: path.join(__dirname, "static")
}

Directory

|--{basepath}
|   |--commons
|   |   |--test.js
|   |--methods
|   |   |--test.js
|   |--services
|   |   |--test-router.json
|   |   |--test.js
|--server.js

Global variables

|Name|Path|Export Variables|Export methods| |---|---|---|---| |brcx|commons/|UpperCase named, number & string|all| |brmx|method/|UpperCase named, number & string|lowercase named|

Router And Processor

services/test-router.json

{
    "processors": [
        {
            "url": "/benchmark",
            "method": "GET",
            "processor": "benchmark_empty",
            "parameters": []
        }
    ]
}

services/test.js

exports.benchmark_empty = function(req, res) {
    brmx.benchmark(function() {
        res.send('OK');
    });
};

methods/test.js

exports.benchmark = function(callback) {
    callback(null);
};

Router File Format

it has three style, Object(container), Array(group), Object(group).

Object(container)

|Key|Type|Default|Description| |---|---|---|---| |parameters|Array(Parameger)|[]|the common parameters| |interceptor|XArray(string)|[]|the common interceptor names| |failure|stirng|undefined|the default failure processor name| |groups|Array(group)|required|the router group|

Object(group)

|Key|Type|Default|Description| |---|---|---|---| |parameters|Array(Parameger)|[]|the common parameters| |interceptor|XArray(string)|[]|the interceptor names| |failure|stirng|undefined|the failure processor name| |processors|Array(processor)|required|the router parameters|

Object(processor)

|Key|Type|Default|Description| |---|---|---|---| |method|XArray(string)|required|METHOD| |url|XArray(string)|required|URL| |parameters|Array(parameger)|[]|the common parameters| |failure|stirng|undefined|the failure processor name| |processor|string|required|the processor name| |workdata|Object|undefined|attach to req| |workparam|Object|undefined|attach to req|

Object(parameter)

This is a Array type model definition in field-inspector, click it for more detail.

req.files Information

It's array of file, And each file contains the following information:

|Key|Description| |---|---| |name | Field name specified in the form | |type | Mime type of the file | |size | Size of the file in bytes | |path | The full path to the temp uploaded file | |originalFilename | Name of the file on the user's computer |

Examples

demo

License

MIT