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

sf-sketch-rpc

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sf-sketch-rpc - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

16

lib/scripts.js

@@ -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 @@ };

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