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

tcl

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcl - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

22

lib/result.js
'use strict';
/**
* Represents a Tcl command result
*
* @constructor
* @param {string} data - raw response data
* @param {object} interp - Tcl interpreter binding
*/
var Result = function ( data, interp ) {

@@ -17,2 +23,7 @@

/**
* Returns raw resonse data
*
* @return {string} Raw response data
*/
Result.prototype.data = function () {

@@ -23,2 +34,11 @@ return this._result.raw;

/**
* Converts a string that represents a Tcl list into a JavaScript array using
* native Tcl binding. If a string is not passed in as a parameter, the
* internal response data representation will be used.
*
* @param {(string|null)} str - Tcl list as a string
* @return {Array} When the conversion is successful
* @return {null} When the conversion fails
*/
Result.prototype.toArray = function ( str ) {

@@ -25,0 +45,0 @@

@@ -7,3 +7,6 @@

/**
* Tcl Interpreter bridge
* @constructor
*/
var Tcl = function () {

@@ -23,2 +26,9 @@

/**
* Execute a Tcl command using the Tcl Interpreter
* binding
* @param {string} cmd - command to execute
* @param {Tcl~cmdCallback} callback - callback method to handle
* the response
*/
Tcl.prototype.cmd = function ( cmd, callback ) {

@@ -42,2 +52,6 @@

/**
* Returns the Tcl Interpreter version
* @return {string} Tcl version
*/
Tcl.prototype.version = function () {

@@ -54,5 +68,21 @@

// jsdoc definitions
/**
* Error first callback method to return error and response data after executing
* a Tcl command
* @callback Tcl~cmdCallback
* @param {(Error|null)} err - JavaScript Error object with error details upon error or null
* @param {Result} result - object containing response data from the executed Tcl command
*/
var tcl = new Tcl();
/**
* Tcl module representing a @type {Tcl} instance
* @module tcl
*/
module.exports = tcl;

3

package.json
{
"name": "tcl",
"version": "1.0.0",
"version": "1.0.1",
"description": "Node.js Tcl binding",

@@ -9,2 +9,3 @@ "main": "index.js",

"coveralls": "istanbul cover _mocha --report lcovonly -- --reporter spec && cat ./coverage/lcov.info | coveralls",
"docs": "jsdoc -c jsdoc-conf.json ./README.md",
"lint": "jshint index.js lib test",

@@ -11,0 +12,0 @@ "test": "mocha"

@@ -10,9 +10,28 @@ node-tcl

Node.js Tcl bindings
Node.js Tcl bindings to execute Tcl commands using a native Tcl Interpreter.
## Installation
**Prerequisites : ** You will need to have ```tcl-dev``` packages installed on
your system (e.g. ```sudo apt-get install tcl-dev```) for the Node.js native addon
to link to.
```sh
$ npm install --save tcl
```
## Usage
You can execute any Tcl command that is supported by the Tcl shell (```tchsh```)
and you can even load native Tcl modeles (```load module.so```), source scripts
(```source filename.tcl```) and source Tcl libraries (```package require name```).
``` js
var tcl = require( 'tcl' );
console.log( tcl.version() );
tcl.cmd( 'info tclversion', function ( err, result ) {

@@ -27,1 +46,11 @@ console.log( result.data() );

## API Documentation
JSDoc generated API documentation can be found at [http://nukedzn.github.io/node-tcl/docs/](http://nukedzn.github.io/node-tcl/docs/).
## Contributing
Contributions are welcome through GitHub pull requests ([using fork & pull model](https://help.github.com/articles/using-pull-requests/#fork--pull)).
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