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

untitled-js

v1.0.9

Published

Node js web framework.

Downloads

9

Readme

Untitled-JS

Fast, experimental, minimalist web framework for node.

NPM Version NPM Downloads

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

Installation is done using the npm install command:

$ npm install untitled-js

Follow our installing guide for more information.

Features

  • Virtual routing
  • Focus on rapid development
  • MYSQL AutoQuery Generator (untitled-model)
  • View system supporting 3+ template engines
  • Middleware Support
  • Session Support
  • Content negotiation
  • Executable for generating applications quickly

Docs & Community

Security Issues

If you discover a security vulnerability in untitled-js, please see Contact Us.

Quick Start

The quickest way to get started with untitled-js is to utilize the executable untitled-generator to generate an application as shown below:

$ npm install -g untitled-generator

Create the app:

$ mkdir myFirstApp && cd myFirstApp
$ untitled init

Install dependencies:

$ npm install

Start the server:

$ node app.js

Philosophy

The Untitled philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.

Untitled does not force you to use any specific template engine. With support for over 3 template engines. you can quickly craft your perfect framework.

People

The original author of Untitled is [Harendra Chhekur & Pankaj Devesh]

Documentation

Create New Project

$ mkdir MyProject && cd MyProject
$ npm init
$ untitled init
$ npm install

If there is error in any statement #

Creating Server

var untitled = require('untitled-js');
untitled.settings = require('./__settings/settings');
untitled.startServer(8080);
/*
*  or 
*  untitled.startServer();
*  or
*  untitled.startServer(port, host);
* /

Run Server

$ node app.js

Funtions

Creating Page

$ touch HelloWorld.jss

open this file in any text editor

var untitled = requier('untitled-js');
var page = untitled.page();

page.run = function(req,res){
    return true;
}

page.get = function(req,res){
    res.send('Hello world!');
}

module.exports = get;

Handling Requests On Pages

  • page.run = function(req,res){return true;}
  • page.get = function(req,res){}
  • page.post = function(req,res){}

page.run

This is a pre processing function, which invoked before any other function of page. It must return true or false. Further execution of page will continue iff it returns true.

example

page.run = function(req,res){
    
    if(1 + 1 == 2){
        return true;
    }
    res.send('<meta http-equiv="refresh" content="0;URL=http://untitled-js.com" /> ');
    return false;
}

page.get

This function accept get request.

example

page.get = function(req,res){
    var value = req.GET;
    
    res.send('values of all get parameter');
    res.send(JSON.stringify(value));
    
    value = req.GET.get('name');
    res.send('value of specific parameter');
    res.send(value);
    
    value = req.GET['name'];
    res.send('value of specific parameter');
    res.send(value);
}

page.post

This function accept post request.

example

page.post = function(req,res){
    var value = req.POST;
    
    res.send('values of all post parameter');
    res.send(JSON.stringify(value));
    
    value = req.POST.get('name');
    res.send('value of specific parameter');
    res.send(value);
    
    value = req.POST['name'];
    res.send('value of specific parameter');
    res.send(value);
}

Rendering Templates

res.render(filename, options);
    filename = '*.jade' || '*.ejs' || '*.html';

Ex:
// res.render('template/error_log.jade',{title:error});

Redirect Url's

example

res.redirect('https://google.com');

Session Handling

req.session.put(key,value) Put value in session

example

req.session.put('name','Alex');

req.session.get(key) Get value from session

example

var name = req.session.get('name');

Url Management

In home directory of you project you'll find url.json

example

{
  "/login" : "/front/login.ejs",
  "/register" : "/back/register.jss",
}

here left side you just have to write virtual path that you want to locate your original path defined on righ side

Static File Management

you can save your all static files inside the static folder, then it'll not gonna execute

Middlewares

you can define you own middlewares and save them in folder named middlewares or chage the directory in settings, in case you want

Security

if you want to restrict some files or directory to user access from browser.
you can just simply add __ at the string of that file or directory

example:
__settings, __index.html

Settings

var path = require('path');
module.exports = {

	HOST:"127.0.0.1", // Default Host
	PORT:"3000", // Default Port
	DEBUG:true, // Debugging Mode

	SESSION:true, // Enabled Session

	DATABASE : {
		default:{
			host: "localhost",
		    user: "root",
		    password: "",
		    database:"test"
		}
	}, // Default Database Settings


	HOME_PAGE: 'template/index-1.jade', // Home Page


	MIDDLEWARES : [
		'middlewares/favicon',
		'middlewares/check_user',
		'middlewares/access_denied'
	],  // MIddlewares

	MODEL_DIR  : path.join(__dirname, '..' , 'models'), // Path of models
	STATIC_DIR : path.join(__dirname, '..' , 'static'), // Path of static files 
	BASE_DIR : path.join(__dirname, '..' ), // Path of root directory

	ERROR_PAGE : 'template/error_log.jade', // Error Page

	TEMPLATES_DIR : path.join(__dirname, '..' ,'template'), // Path of Template

	URL_REWRITE_FILE : path.join(__dirname,'..') // Path of urls

}

License

MIT