Browse Source

added git repo to package.json

master
mort 8 years ago
parent
commit
9a1eb3038e
2 changed files with 12 additions and 6 deletions
  1. 6
    4
      index.js
  2. 6
    2
      package.json

+ 6
- 4
index.js View File

} }
Func.prototype = Function.prototype; Func.prototype = Function.prototype;


module.exports = function(str, vals) {
function Templish(str, vals) {
str = str.replace(/\s+/g, " ").replace(/}}/g, "}}\n"); str = str.replace(/\s+/g, " ").replace(/}}/g, "}}\n");
this.string = str; this.string = str;
this.vals = vals; this.vals = vals;
}.bind(this)); }.bind(this));
} }


module.exports.prototype.exec = function(vals, cb) {
Templish.prototype.exec = function(vals, cb) {
var str = this.string; var str = this.string;


//Prepare generic arguments //Prepare generic arguments
//If this is the last callback to be executed, //If this is the last callback to be executed,
//call back with the resulting string //call back with the resulting string
if (cbsRemaining <= 0) if (cbsRemaining <= 0)
cb(str);
cb(null, str);
cbsRemaining -= 1; cbsRemaining -= 1;
} }


//If there's no asynchronous functions to wait for, //If there's no asynchronous functions to wait for,
//just call back immediately //just call back immediately
if (cbsRemaining === 0) if (cbsRemaining === 0)
return cb(str);
return cb(null, str);
} }

module.exports = Templish;

+ 6
- 2
package.json View File

{ {
"name": "templish", "name": "templish",
"version": "0.0.1",
"version": "0.0.2",
"description": "HTML templating library for JS", "description": "HTML templating library for JS",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "Martin Dørum Nygaard", "author": "Martin Dørum Nygaard",
"license": "MIT"
"license": "MIT",
"repository": {
"type": "git",
"url": "gogs@git.mort.coffee:mort/templish.git"
}
} }

Loading…
Cancel
Save