Socket
Socket
Sign inDemoInstall

bm-email-templatizer

Package Overview
Dependencies
292
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.9 to 1.8.0

9

example/app.js
var bmEmailTemplatizer = require('../lib'),
path = require('path');
function sendToMandrill() {
}
var options = {

@@ -14,3 +17,9 @@ paths: {

}
},
options: {
pretty: true
}
},
i18nConfigs: {
objectNotation: true
}

@@ -17,0 +26,0 @@ };

3

example/locales/ar.json
{
"full-name": "احمد باميه"
"full-name": "احمد باميه",
"missing-in-arabic": "missing-in-arabic"
}
{
"full-name": "Ahmad Bamieh"
"full-name": "Ahmad Bamieh",
"missing-in-arabic": "not missing in English"
}

@@ -1,3 +0,3 @@

var pug = require('pug'),
path = require('path');
var cons = require('consolidate'),
extend = require('./extend-mixin');

@@ -10,18 +10,16 @@ module.exports = function compilePug() {

var activeFile = settings.activeFile;
if(!activeFile) return reject(new Error('activeFile undefined'))
if(!activeFile) return reject(new Error('activeFile undefined'));
settings.consolidate.locals.setLocale(settings.activeLocale);
var fn = pug.compileFile(activeFile, settings.consolidate.options);
var mergedOptions = extend(true, settings.consolidate.options, settings.consolidate.locals);
resolve({
"html": fn( settings.consolidate.locals )
var viewEngine = settings.consolidate.viewEngine;
cons[viewEngine](activeFile, mergedOptions, function(err, html){
if (err) return reject(err);
resolve({ "html": html });
});
});
}
/*
to render pug:
var html = pug.renderFile(destPath, locale);
resolve({renderedHtml: html});
*/
{
"name": "bm-email-templatizer",
"version": "1.7.9",
"version": "1.8.0",
"description": "create email templates through jade/pug, sass, and locale json files",

@@ -35,2 +35,3 @@ "main": "lib/index.js",

"dependencies": {
"consolidate": "^0.14.1",
"glob": "^7.0.5",

@@ -37,0 +38,0 @@ "i18n": "^0.8.3",

@@ -10,3 +10,16 @@ #bmEmailTemplatizer

##Usage
###Minimal
```javascript
var bmEmailTemplatizer = require('bm-email-templatizer');
bmEmailTemplatizer
.allLocalesAllFiles()
.then(function(results) {
console.log('results', results);
})
.catch(function(err) {
console.log('error', err);
});
```
##API

@@ -34,16 +47,3 @@ ###setOptions

###Minimal
```javascript
var bmEmailTemplatizer = require('bm-email-templatizer');
bmEmailTemplatizer
.allLocalesAllFiles()
.then(function(results) {
console.log('res', results);
})
.catch(function(err) {
console.log('error', err);
});
```
#Options

@@ -50,0 +50,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc