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

node-cfml

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cfml

a CFML template engine for node.js

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-cfml

A simple cfml template engine for node.js/express

Introduction

Version 1.0 is out! It's a complete rewrite of what started out as a few regexps quickly thrown together. It is now a decently fast template engine. It uses a static cache, it supports tag nesting, comments, dynamic variable names, etc. It behaves mostly like Coldfusion but it interprets javascript code. (eg: arrays start at 0). Just use it like you would any other express template engine. Enjoy the clean views, the tag completion and color coding ... Using tags for view logic in HTML actually kicks ass.

Support

Only a few CFML tags have been implemented. It wouldn't make sense to use most other CF tags in a view. The implemented tags are:

  • CFSET
  • CFOUTPUT
  • CFIF
  • CFLOOP
  • CFPARAM
  • CFSAVECONTENT
  • CFINCLUDE
  • CFBREAK
  • CFABORT

The implemented CF operators are:

  • EQ, IS
  • NEQ, IS NOT
  • LT
  • GT
  • LTE, LE
  • GTE, GE
  • NOT
  • CONTAINS
  • AND, OR
  • MOD
  • &

You can also use javascript operators directly. The parser will not like the > operator in tags so use GT or GTE in a CFIF tag.

Installation

npm install node-cfml --save

Usage

var express = require('express')
var app = express()
var cfml = require('node-cfml')

app.engine('cfm', cfml.renderFile)
app.set('view engine', 'cfm')
app.get('/', function (req, res) {
	res.render('test.cfm')
})

var server = app.listen(3000, function () {
	var host = server.address().address
	var port = server.address().port

	console.log('Example app listening at http://%s:%s', host, port)
})

Tests

Just run

mocha

to run the tests

Keywords

FAQs

Package last updated on 18 Nov 2015

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