json_script
Advanced tools
Comparing version 0.0.1 to 0.0.2
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; |
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6044
0
68
190
- Removedminimist@^1.2.0
- Removedminimist@1.2.8(transitive)