eof

0.0.3 • Public • Published

eof

Build Status Build Status

Extract template from multi-line comment inside function body.

I use it in tests when you don't want to make templates outside of the test. So it looks more readable than an array of strings or multi-line strings (I believe in it) and simple then outside file.

Enjoy testing!

Getting Started

Install the module with: npm install eof

  var eof = require('eof');
  eof.extract(function() {
    /*
      Hello World
    */
  });

Examples

Extract simple text template

  var eof = require('eof');
  eof.extract(function() {
    /*
      Hello World
    */
  });

Extract javascript template. And format it throught js-beautify

  var eof = require('eof');
  eof.extract(function() {
    /*
        var max = function() {
            return Math.max.apply(null, arguments);
        };
    */
  }).format('javascript');

You can look at test directory for live example

License

Copyright (c) 2013 Maksim Ryzhikov
Licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i eof

Weekly Downloads

0

Version

0.0.3

License

none

Last publish

Collaborators

  • maksimr