New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jade2script

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jade2script

A jade to script compiler

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jade2script

A jade to client javascript compiler tool / 一种利用jade模板生成客户端javascript组件的编译工具

installation

jade2script is a registered npm module. So you can install it using the following command:

npm install jade2script

推荐使用gulp 可参照demo进行编写

应用指南

该项目目前应用于Verge Video Player的组件编译

如果需要在客户端使用 需引用lib/client_base.js模块

Demo

完整实例见代码

  • input: ** main.jade
.main
    include view/hello-world

** view\hello-world.jade

.main
    include view/hello-world
  • output:
//base lib code

base.routes("Main",true);
Main = function(options){
	var frag = document.createDocumentFragment();
	var  fc_0 = base.create('div',{"className":'main'});
	var fc_0_0 = new view.HelloWorld();
	fc_0.append(fc_0_0.fragment);
	frag.appendChild(fc_0);
	this.fragment = frag;
	return frag;
};

base.routes("view.HelloWorld",true);
view.HelloWorld = function(options){
	var frag = document.createDocumentFragment();
	var  fc_0 = base.create('span',{"className":'hello'});
	fc_0.html('helloWorld!');
	frag.appendChild(fc_0);
	this.fragment = frag;
	return frag;
};

相关构建脚本: gulpfile.js tools/build.js

实现参照

maybe you need ?

License

The MIT License (MIT), read LICENSE for more information

Keywords

FAQs

Package last updated on 24 Mar 2016

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