Socket
Socket
Sign inDemoInstall

code-templates

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-templates

simple code template or snippets manager written in node.js


Version published
Maintainers
1
Created
Source

This software is in development !!

Templates

A simple templates or code snippets manager written in Node.js, for developers.

[ see demo ] (http://templates-harish2704.rhcloud.com/)

Features

  • Powerful and flexible template engine (ECT.js) for rendering code template to code. supports coffeescript syntax.
  • Powerful text editor (ACE Editor). Supports several language syntax, language snippets, themes many more.
  • In-build template helpers ('pluralise', 'singularize', 'capitalize', 'small' )

Usage

Installation

git clone https://github.com/harish2704/templates.git;
cd templates;
npm Install;
node server.js &;
xdg-open http://localhost:3000;

Usage

Create a new snippet template.
  • Sample data

      name :: "Express.js controller Index function"
    
      settings :: { "model": "string" }
    
      Source ::
              <% modelClass = @capitalize @model; modelObject = @small @model; modelObjects = @small (@pluralize @model ) %>
              function(req, res ) {
    
                  <%- modelClass %>.count( {}, function( err, count ){
                      var paginationParams = {};
                      paginationParams.count = count;
                      paginationParams.page = req.query.page;
    
                      var pagination = paginator.paginate( paginationParams );
    
                      return <%- modelClass %>.find( { }).slice([pagination.start-1, paginator.defaults.size]).exec(function( err, <%- modelObject %> ){
                          return res.respond('<%- modelObjects %>/index', { <%- modelObjects %>: <%- modelObjects %>, pagination: pagination });
                      });
                  });
              }
    
Generate code from this template.
  • Enter value for each settings keys.
  • View code in the editor by pressing submit button
Syntax
  • settings

    Strict json

    {
        'parameter-name' : 'type'
    }
    

    available types

      'string' => textbox
      'number' => textbox
      'boolean' => checkbox 
    
  • Template

    Refer ECT.js template engine.

    built-in filters

      'capitalize', 'small', 'singularize', 'pluralize'
    

Keywords

FAQs

Package last updated on 15 Mar 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