esketch
Version:
Node.js addon template
49 lines (37 loc) • 1.62 kB
JavaScript
/*
Copyright (C) 2007-2017 Claude SIMON (http://q37.info/contact/).
This file is part of eSketch.
eSketch is free software: you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
eSketch is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with eSketch. If not, see <http://www.gnu.org/licenses/>.
*/
var affix = "esketch";
// Begin of generic part.
var njsq = null;
var componentPath = null;
var componentFilename = null;
var path = require("path");
if (process.env.EPEIOS_SRC) {
if (process.platform == 'win32')
componentPath = 'h:/bin/';
else
componentPath = '~/bin/';
njsq = require(componentPath + 'njsq.node');
} else {
njsq = require('njsq');
componentPath = __dirname;
}
componentFilename = path.join(componentPath, affix + "njs").replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/ /g, "\\ ");
const esketch = njsq._register(componentFilename);
module.exports.componentInfo = () => njsq._componentInfo(esketch);
module.exports.wrapperInfo = () => njsq._wrapperInfo();
// End of generic part.
module.exports.returnArgument = (text) => { return njsq._wrapper(esketch, 0, text) };