New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pug-cli

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-cli - npm Package Compare versions

Comparing version 1.0.0-alpha2 to 1.0.0-alpha3

a.html

9

HISTORY.md

@@ -5,2 +5,8 @@ # Change Log

## [1.0.0-alpha3] - 2016-05-18
### Added
- Node.js module as option file is supported as well.
- Some examples have been added to the documentation on how to use `-O`.
## [1.0.0-alpha2] - 2016-05-18

@@ -58,3 +64,4 @@

[unreleased]: https://github.com/pugjs/pug-cli/compare/0.1.1...master
[unreleased]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha3...master
[1.0.0-alpha3]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha2...1.0.0-alpha3
[1.0.0-alpha2]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha1...1.0.0-alpha2

@@ -61,0 +68,0 @@ [1.0.0-alpha1]: https://github.com/pugjs/pug-cli/compare/0.1.1...1.0.0-alpha1

32

index.js

@@ -61,2 +61,14 @@ #!/usr/bin/env node

console.log('');
console.log(' # Specify options through a string:');
console.log(' $ pug -O \'{"doctype": "html"}\' foo.pug');
console.log(' # or, using JavaScript instead of JSON');
console.log(' $ pug -O "{doctype: \'html\'}" foo.pug');
console.log('');
console.log(' # Specify options through a file:');
console.log(' $ echo "exports.doctype = \'html\';" > options.js');
console.log(' $ pug -O options.js foo.pug');
console.log(' # or, JSON works too');
console.log(' $ echo \'{"doctype": "html"}\' > options.json');
console.log(' $ pug -O options.json foo.pug');
console.log('');
});

@@ -77,13 +89,17 @@

function parseObj (input) {
var str;
try {
str = fs.readFileSync(program.obj, 'utf8');
return require(path.resolve(input));
} catch (e) {
str = program.obj;
var str;
try {
str = fs.readFileSync(program.obj, 'utf8');
} catch (e) {
str = program.obj;
}
try {
return JSON.parse(str);
} catch (e) {
return eval('(' + str + ')');
}
}
try {
return JSON.parse(str);
} catch (e) {
return eval('(' + str + ')');
}
}

@@ -90,0 +106,0 @@

{
"name": "pug-cli",
"version": "1.0.0-alpha2",
"version": "1.0.0-alpha3",
"description": "Pug's CLI interface",

@@ -5,0 +5,0 @@ "bin": {

@@ -67,2 +67,20 @@ # pug-cli

Specify options through a string:
```
$ pug -O '{"doctype": "html"}' foo.pug
# or, using JavaScript instead of JSON
$ pug -O "{doctype: 'html'}" foo.pug
```
Specify options through a file:
```
$ echo "exports.doctype = 'html';" > options.js
$ pug -O options.js foo.pug
# or, JSON works too
$ echo '{"doctype": "html"}' > options.json
$ pug -O options.json foo.pug
```
## Installation

@@ -69,0 +87,0 @@

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