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

utc

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

utc

Simple underscore.js template compiler.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
increased by16.85%
Maintainers
1
Weekly downloads
 
Created
Source

utc

Simple underscore.js template compiler.

Getting Started

Install the module with: npm install -g utc

Using utc (CLI)

Once you have installed utc type utc --help to see all available options

Options:
    -h, --help              output usage information
    -V, --version           output the version number
    -d, --directory         directory
    -s, --fileSuffix        file suffix
    -f, --functionSuffix    function suffix

Examples

Inside 'templates' folder create a file called 'sampleTemplate.js':

(function () {
    define(function () {
        return {
            getListTemplateStr: function () {
                return this._helper() + ": <%= name %>";
            },
            _helper: function () {
                return "hello";
            }
        };
    });
}).call(this);

run utc -d "templates" -s "Template" -f "Str" and you should have the same file with a new content

(function () {
    define(function () {
        return{
            getListTemplateStr: function (obj) {
                var __p = '';
                var print = function () {
                    __p += Array.prototype.join.call(arguments, '')
                };
                with (obj || {}) {
                    __p += 'hello: ' +
                        ( name ) +
                        '';
                }
                return __p;
            }
        };
    });
}).call(this);

License

Copyright (c) 2012 nowamasa
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 23 Jun 2012

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