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

odesza

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

odesza - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

27

cli.js
#!/usr/bin/env node
var program = require('commander');
var fs = require('fs');
var package = require('./package.json');
var odesza = require('./');
'use strict'
const fs = require('fs');
const program = require('commander');
const odesza = require('./');
const app = require('./package.json');
program
.version(package.version)
.usage('<file> [options]')
.version(app.version)
.usage('<file> [options] var1=val var2=val2]')
.description('Compiles odesza templates.')

@@ -15,5 +17,16 @@ .option('-o, --output', 'output file')

const file = program.args.shift();
if (program.output) {
const output = program.args.shift();
}
var template = odesza.compile(program.args[0]);
const vars = {};
program.args.forEach(arg => {
let parts = arg.split('=');
vars[parts[0]] = parts[1];
});
const template = odesza.renderFile(file, vars);
if (program.output) {

@@ -20,0 +33,0 @@ fs.writeFileSync(program.args[1], template);

{
"name": "odesza",
"version": "0.5.0",
"version": "0.6.0",
"description": "Write clean, expressive templates with just HTML and inline JavaScript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,3 @@ 'use strict';

const fixture = file => path.join(__dirname, 'fixtures', file);
const exec = require('child_process').exec;

@@ -119,1 +120,9 @@ test('render variable', t => {

});
test('cli usage with variables', t => {
let vars = { value: 'world' };
exec('node cli test/fixtures/simple value=world', (err, stdout, stderr) => {
t.ok(stdout == 'hello world', 'rendering file with variables works from the command line');
t.end();
});
});
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