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

carto

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carto - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md
# Changelog
## 1.0.1
* Fix a error in the serialization process. ([#473](https://github.com/mapbox/carto/issues/488))
## 1.0.0

@@ -4,0 +8,0 @@

2

lib/carto/util.js

@@ -171,3 +171,3 @@ var _ = require('lodash');

}
else {
else if (!_.isNil(json)) {
return json.toString();

@@ -174,0 +174,0 @@ }

{
"name": "carto",
"version": "1.0.0",
"version": "1.0.1",
"description": "Mapnik Stylesheet Compiler",

@@ -5,0 +5,0 @@ "url": "https://github.com/mapbox/carto",

@@ -64,38 +64,40 @@ # CartoCSS

// defined variables:
// - input (the name or identifier of the file being parsed)
var carto = require('carto');
```javascript
// defined variables:
// - input (the name or identifier of the file being parsed)
var carto = require('carto');
try {
var data = fs.readFileSync(input, 'utf-8');
var mml = new carto.MML({});
mml.load(path.dirname(input), data, function (err, data) {
var output = {};
try {
var data = fs.readFileSync(input, 'utf-8');
var mml = new carto.MML({});
mml.load(path.dirname(input), data, function (err, data) {
var output = {};
if (!err) {
output = new carto.Renderer({
filename: input
}).render(data);
}
if (!err) {
output = new carto.Renderer({
filename: input
}).render(data);
}
if (output.msg) {
output.msg.forEach(function (v) {
if (v.type === 'error') {
console.error(carto.Util.getMessageToPrint(v));
}
else if (v.type === 'warning') {
console.warn(carto.Util.getMessageToPrint(v));
}
});
}
if (output.msg) {
output.msg.forEach(function (v) {
if (v.type === 'error') {
console.error(carto.Util.getMessageToPrint(v));
}
else if (v.type === 'warning') {
console.warn(carto.Util.getMessageToPrint(v));
}
});
}
// output content (if no errors)
if (output.data) {
console.log(output.data);
}
});
} catch (err) {
// program failures
...
}
// output content (if no errors)
if (output.data) {
console.log(output.data);
}
});
} catch (err) {
// program failures
...
}
```

@@ -102,0 +104,0 @@ If you want to use CartoCSS within the browser you should not use MML loading via `carto.MML.load`.

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