sf-sketch-rpc
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -10,10 +10,2 @@ Object.defineProperty(exports, "__esModule", { | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _path = require('path'); | ||
var _path2 = _interopRequireDefault(_path); | ||
var _mustache = require('mustache'); | ||
@@ -29,4 +21,10 @@ | ||
var templates = { | ||
'bootstrap-plugin-instance': require('raw-loader!./templates/bootstrap-plugin-instance.js'), | ||
'coscript-executor': require('raw-loader!./templates/coscript-executor.js'), | ||
'plugin-command-executor': require('raw-loader!./templates/plugin-command-executor.js') | ||
}; | ||
var readTemplateNamed = function readTemplateNamed(name) { | ||
var script = _fs2['default'].readFileSync(_path2['default'].join(_path2['default'].resolve(__dirname, 'templates'), String(name) + '.js'), 'utf8'); | ||
var script = templates[name]; | ||
return _lodash2['default'].replace(_lodash2['default'].replace(script, /"<</g, ''), />>"/g, ''); | ||
@@ -33,0 +31,0 @@ }; |
{ | ||
"name": "sf-sketch-rpc", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "RPC module based on `coscript` cli for running scripts in Sketch runtime on node.js platform", | ||
@@ -38,4 +38,5 @@ "main": "lib/index.js", | ||
"babel-cli": "^6.24.1", | ||
"babel-preset-airbnb": "^2.2.3" | ||
"babel-preset-airbnb": "^2.2.3", | ||
"raw-loader": "^0.5.1" | ||
} | ||
} |
import _ from 'lodash' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import Mustache from 'mustache'; | ||
import jsStringEscape from 'js-string-escape'; | ||
const templates = { | ||
'bootstrap-plugin-instance': require('raw-loader!./templates/bootstrap-plugin-instance.js'), | ||
'coscript-executor': require('raw-loader!./templates/coscript-executor.js'), | ||
'plugin-command-executor': require('raw-loader!./templates/plugin-command-executor.js'), | ||
}; | ||
const readTemplateNamed = (name) => { | ||
let script = fs.readFileSync(path.join(path.resolve(__dirname,'templates'),`${name}.js`),'utf8'); | ||
let script = templates[name]; | ||
return _.replace(_.replace(script,/"<</g,''),/>>"/g,''); | ||
@@ -11,0 +15,0 @@ }; |
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
29246
519
2
3