This package has been deprecated

Author message:

unsupported

higgytools

1.5.12 • Public • Published

higgytools

A collection of node simplifications for web serving and requesting (along with some system commands implemented).

NOTE: If you use C#, check out https://github.com/haydenhigg/Vitesse for the fully-developed version of this package, and a nodejs version of Vitesse is coming soon.

To quickly test the package after installation, type this command from your package directory: node node_modules/higgytools/test.js

utility

Miscellaneous helper functions

parse URL parameters to JSON by providing the result of url.parse(path)

parseParameters(request)

requests

Simplified GET and POST requests

GET

get(url, callback[, binary = false])

POST

post(url, body, callback[, responseType = "text/plain"])

serving

Each of these returns a server. A simple HTTP server, a server to serve one file quickly, a powerful static file server, or a server with direct control over the responses with routes.

serve

serve(callback)

serve a file

serveFile(filePath)

serve all static files

serveStatic()

The optional first argument is routes, which will serve as an override to the static response. See the serveRoutes function for more detail on routes. You can specify how many folders deep to start the file search by setting the module's parentDirectories property (default is 0). You can specify an anchor file by setting the module's anchor property.

dynamically serve manually specified routes

serveRoutes(routes)

Routes is an object of

{route: function(request) {
    return {body: body, options: options};
}}

or

{route: function(request, response)}

where route is a string path, request is a URL object, the body of the return object is the body of the response, and the options are the options to write to the head of the response.

system commands

If you have these tools installed this can provide just a simple node interface with them.

arp

arp(callback[, options = ""])

nmap

nmap(ip, callback[, options = ""])

listIPs

listIPs(min, max)

Manually tries to find a hostname for every ip from xxx.xxx.xx.min to xxx.xxx.xx.max. The beginning is found from the router's IP address.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i higgytools

Weekly Downloads

0

Version

1.5.12

License

MIT

Unpacked Size

33.6 kB

Total Files

7

Last publish

Collaborators

  • npm