Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kiss.js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kiss.js

Web framework for node.js in CoffeeScript. Simple and sexy.

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Web framework for node.js in CoffeeScript. Simple and sexy.

Object-oriented web framework on Node.js, written in CoffeeScript.

Installation

  • Get npm (http://npmjs.org)
  • run
    npm install kiss.js
  • (optionaly) If you want write project in CoffeeScript
    npm install coffee-script
  • Done

Usage

  • Create project(it is just good files structure, you can configure it via application options)
    kiss new path/to/new/project
  • core/app.coffee
      kiss = require "kiss.js"
      controllers = require "../controllers/controllers"
      args = process.argv.splice 2
      address = "127.0.0.1"
      port = 1337
      if args[0]
      	address = args[0]
      if args[1]
      	port = parseInt args[1]	
      my_controller = new controllers.MyController()
      options =
      	application:
      		address: address || "127.0.0.1"
      		port: port || 1337
      	views:
      		static_path: __dirname + "/../views/static/"
      		template_path: __dirname + "/../"
      		locale_path: __dirname + "/../views/locales/"
      		cookie_secret: "ertyu78f020fk"
      	urls:
      		"/": my_controller
      		"/user":
      			"/posts": my_controller
      app = new kiss.core.application.Application(options)
      app.start()
      
  • controllers.js
    
    

kiss = require "kiss.js" class MyController get: (req, res) -> req.session.views ?= 0 req.session.views++ context = { foo: req.session.views, names: ["Stas", "Boris"], numbers: [], name: -> "Bob " + "Marley" } for i in [0..10] context.numbers.push "bla bla " + i res.template "view.html", context

post: (req, res) ->
	res.text "hello from post"

exports.MyController = MyController

  • view.html Kiss.js uses Django-like templates from swig. See project folder. Client-side coffee scripts will be compile on the start. For styling use Stylus, it also compiles on the start.

Keywords

FAQs

Package last updated on 19 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc