Socket
Socket
Sign inDemoInstall

pug

Package Overview
Dependencies
8
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0 to 0.1.0

.editorconfig

85

package.json
{
"name": "pug",
"version": "0.0.0",
"description": "Nodejs ORM using Postgres",
"main": "pug.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"description": "A clean, whitespace-sensitive template language for writing HTML",
"version": "0.1.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"maintainers": [
"Forbes Lindesay <forbes@lindesay.co.uk>",
"Matthias Le Brun <mlbli@me.com>",
"Joshua Appelman <joshua@jbna.nl>",
"Jonathan Ong <jonathanrichardong@gmail.com>",
"Alex Kocharin <alex@kocharin.ru>",
"Hemanth <hemanth.hm@gmail.com>",
"Timothy Gu <timothygu99@gmail.com>",
"Andreas Lubbe <git@lubbe.org>"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/weareflavor/pig.git"
"url": "git://github.com/jadejs/jade"
},
"author": "Flavor",
"license": "MIT",
"readmeFilename": "README.md",
"gitHead": "7f7d699362b09a010603e8ac7e683d51886881c4",
"main": "lib",
"bin": {
"jade": "./bin/jade.js"
},
"dependencies": {
"pg": "~2.3.1"
}
"pug-code-gen": "0.0.0",
"pug-filters": "1.1.0",
"pug-lexer": "0.0.0",
"pug-linker": "0.0.0",
"pug-loader": "0.0.0",
"pug-parser": "0.0.0",
"pug-runtime": "0.0.0",
"pug-strip-comments": "0.0.1"
},
"devDependencies": {
"browserify": "*",
"browserify-middleware": "~4.1.0",
"code-mirror": "~3.22.0",
"coveralls": "^2.11.2",
"doctypes": "^1.0.0",
"express": "^4.10.4",
"github-basic": "^5.0.0",
"highlight-codemirror": "^4.6.1",
"inconsolata": "0.0.2",
"istanbul": "*",
"jade-code-mirror": "~1.0.5",
"jade-highlighter": "~1.0.5",
"jquery": "^2.1.4",
"jstransformer-cdata": "^1.0.0",
"jstransformer-coffee-script": "^1.0.0",
"jstransformer-less": "^2.1.0",
"jstransformer-markdown-it": "^0.2.2",
"jstransformer-stylus": "^1.0.0",
"jstransformer-uglify-js": "^1.1.1",
"jstransformer-verbatim": "^1.0.0",
"less-file": "0.0.9",
"linify": "*",
"lsr": "^1.0.0",
"markdown-it": "^5.0.1",
"mocha": "*",
"pull-request": "^3.0.0",
"rimraf": "^2.2.8",
"should": "*",
"stop": "^3.0.0-rc1",
"stylus": "*",
"twbs": "0.0.6",
"uglify-js": "^2.6.1"
},
"scripts": {
"test": "mocha -R spec",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- -R dot",
"coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls",
"prepublish": "npm prune && linify transform bin"
},
"browser": {
"fs": false
},
"homepage": "http://jade-lang.com"
}

@@ -1,16 +0,153 @@

pug
===
# [![Jade - Node Template Engine](http://garthdb.com/img/jade_branding/jade-01.svg)](http://jade-lang.com/)
Nodejs ORM using Postgres
Full documentation is at [jade-lang.com](http://jade-lang.com/)
![](http://31.media.tumblr.com/67ade45a3d0bb49c10ce239918158649/tumblr_mktmla2iZX1rgpyeqo1_400.gif)
Jade is a high performance template engine heavily influenced by [Haml](http://haml.info/)
and implemented with JavaScript for [node](http://nodejs.org) and browsers. For bug reports,
feature requests and questions, [open an issue](https://github.com/jadejs/jade/issues/new).
For discussion join the [chat room](https://gitter.im/jadejs/jade).
Useage
------
You can test drive Jade online [here](http://naltatis.github.com/jade-syntax-docs).
var pug = require('pug').init({
user: process.env.USER || 'yourusername',
database: process.env.DATABASE_URL || 'your_database',
host: process.env.DATABASE_HOST || 'localhost',
port: process.env.DATABASE_PORT || 5432
});
[![Build Status](https://img.shields.io/travis/jadejs/jade/master.svg?style=flat)](https://travis-ci.org/jadejs/jade)
[![Coverage Status](https://img.shields.io/coveralls/jadejs/jade/master.svg?style=flat)](https://coveralls.io/r/jadejs/jade?branch=master)
[![Dependency Status](https://img.shields.io/david/jadejs/jade.svg?style=flat)](https://david-dm.org/jadejs/jade)
[![devDependencies Status](https://img.shields.io/david/dev/jadejs/jade.svg?style=flat)](https://david-dm.org/jadejs/jade#info=devDependencies)
[![NPM version](https://img.shields.io/npm/v/jade.svg?style=flat)](http://badge.fury.io/js/jade)
[![Join Gitter Chat](https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/jadejs/jade?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Installation
via npm:
```bash
$ npm install jade
```
## Syntax
Jade is a clean, whitespace sensitive syntax for writing html. Here is a simple example:
```jade
doctype html
html(lang="en")
head
title= pageTitle
script(type='text/javascript').
if (foo) bar(1 + 5)
body
h1 Jade - node template engine
#container.col
if youAreUsingJade
p You are amazing
else
p Get on it!
p.
Jade is a terse and simple templating language with a
strong focus on performance and powerful features.
```
becomes
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jade</title>
<script type="text/javascript">
if (foo) bar(1 + 5)
</script>
</head>
<body>
<h1>Jade - node template engine</h1>
<div id="container" class="col">
<p>You are amazing</p>
<p>Jade is a terse and simple templating language with a strong focus on performance and powerful features.</p>
</div>
</body>
</html>
```
The official [jade tutorial](http://jade-lang.com/tutorial/) is a great place to start. While that (and the syntax documentation) is being finished, you can view some of the old documentation [here](https://github.com/jadejs/jade/blob/master/jade.md) and [here](https://github.com/jadejs/jade/blob/master/jade-language.md)
## API
For full API, see [jade-lang.com/api](http://jade-lang.com/api/)
```js
var jade = require('jade');
// compile
var fn = jade.compile('string of jade', options);
var html = fn(locals);
// render
var html = jade.render('string of jade', merge(options, locals));
// renderFile
var html = jade.renderFile('filename.jade', merge(options, locals));
```
### Options
- `filename` Used in exceptions, and required when using includes
- `compileDebug` When `false` no debug instrumentation is compiled
- `pretty` Add pretty-indentation whitespace to output _(false by default)_
## Browser Support
The latest version of jade can be download for the browser in standalone form from [here](https://raw.githubusercontent.com/jadejs/jade/1.11.0/jade.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your jade templates to JavaScript and then just use the [runtime.js](https://raw.githubusercontent.com/jadejs/jade/1.11.0/runtime.js) library on the client.
To compile a template for use on the client using the command line, do:
```console
$ jade --client --no-debug filename.jade
```
which will produce `filename.js` containing the compiled template.
## Command Line
After installing the latest version of [node](http://nodejs.org/), install with:
```console
$ npm install jade -g
```
and run with
```console
$ jade --help
```
## Additional Resources
Tutorials:
- cssdeck interactive [Jade syntax tutorial](http://cssdeck.com/labs/learning-the-jade-templating-engine-syntax)
- cssdeck interactive [Jade logic tutorial](http://cssdeck.com/labs/jade-templating-tutorial-codecast-part-2)
- [Jade について。](https://gist.github.com/japboy/5402844) (A Japanese Tutorial)
- [Jade - 模板引擎](https://github.com/jadejs/jade/blob/master/Readme_zh-cn.md)
Implementations in other languages:
- [php](http://github.com/everzet/jade.php)
- [scala](http://scalate.fusesource.org/versions/snapshot/documentation/scaml-reference.html)
- [ruby](https://github.com/slim-template/slim)
- [python](https://github.com/SyrusAkbary/pyjade)
- [java](https://github.com/neuland/jade4j)
Other:
- [Emacs Mode](https://github.com/brianc/jade-mode)
- [Vim Syntax](https://github.com/digitaltoad/vim-jade)
- [TextMate Bundle](http://github.com/miksago/jade-tmbundle)
- [Coda/SubEtha syntax Mode](https://github.com/aaronmccall/jade.mode)
- [html2jade](https://github.com/donpark/html2jade) converter
- [jade2php](https://github.com/SE7ENSKY/jade2php) converter
- [Jade Server](https://github.com/ded/jade-server) Ideal for building local prototypes apart from any application
## License
MIT
bin/pug

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc