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

ctg-compiler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctg-compiler

Sass and dust compiler for client-side templating.

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to the ctg-compiler. This is a little compiler module I made which allows compiling of sass and dust files much easier when using client-side templating.


Installation

$ npm install ctg-compiler

Quick Start

A quick example of it's use would be to watch for file changes for both dust and sass files in a project:

compiler = require('ctg-compiler');

compiler.compileSass("public/includes/sass/main.scss",
					"public/includes/main.css", false, true);

compiler.compileDust("public/includes/dust/home.dust",
					"public/includes/home.js", true);

Note: The paths specified must be relative to the calling script in order for the compiling to be successful.


API Guide

compiler.compileFile(readPath, writePath, watchFile, process)

Reads the contents of the file given from 'readPath' and passes it to the process function. The process function will be given a 'data' parameter containing the data read from readPath. The function will require a return to be written to the given 'writePath'. If you wish to watch a given file, you can set 'watchFile' to true and will thus recompile the file every time a change is made.

compiler.compileSass(readPath, writePath, compressed, watchFile)

Similar to compileFile only a process function is not required, instead a 'compressed' boolean parameter is needed which will affect the outcome of the css file. Used merely to ease compiling of Scss files.

compiler.compileDust(readPath, writePath, watchFile)

Similar to compileFile only a process function is not required. Used merely to ease compiling of Dust files.

FAQs

Package last updated on 01 Jan 2014

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