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

json_script

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json_script - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

6

app.js
var fs = require('fs'),
cssProcessor = require("./lib/processor/css"),
argv = require('minimist')(process.argv);
cssProcessor = require("./lib/processor/css");
console.log('argv:', argv);
module.exports = jsonScript = function(path) {

@@ -18,3 +15,2 @@ var _jsonScript = {};

}
console.log("cssData:", convert.getCss());
cssProcessor(convert.getCss(), callback);

@@ -21,0 +17,0 @@ return _jsonScript;

13

package.json
{
"name": "json_script",
"version": "0.0.1",
"version": "0.0.2",
"description": "css precessor",

@@ -13,11 +13,8 @@ "main": "app.js",

"keywords": [
"['css'",
"'json'",
"'processor']"
"css",
"json",
"processor"
],
"author": "yangxiaofu",
"license": "MIT",
"dependencies": {
"minimist": "^1.2.0"
}
"license": "MIT"
}
## json to css
以json格式来编写css,类似于less、sass这样的css预处理器,这里采用json格式的语法来编写css,如下所示:
类似于less、sass这样的css预处理器,这里采用json格式的语法来编写css,如下所示:

@@ -32,1 +32,37 @@ json文件:

```
## 安装
```git
npm install --save json_script
```
## 使用
1. 新建一个.js文件
2. 添加如下代码
```node
var json_script = require('json_script');
json_script(function(convert) {
convert.css({
'.wrap': {
'margin-top': '20px',
'padding': '20px',
'color': '#444',
p: {
'padding-top': '20px',
'font-size': '28px'
}
}
});
}).render(function(css){
console.log("渲染后的css:");
console.log(css);
})
```
## 资源
* 文档地址: http://www.yangxiaofu.com/json_script
* github: https://github.com/xiaofuzi/json_script
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