node-nikita icon indicating copy to clipboard operation
node-nikita copied to clipboard

docs: tutorial

Open fbraza opened this issue 4 years ago • 0 comments

Sergei,

Regarding the questions I sent you I opened an issue to keep track of the discussion and let you decide if these make sense:

  • Being pretty newbie with JS it was not directly clear to me that I needed to require nikita first. I found it out quickly. Maybe just a mention of it in the text may be needed.

  • In the External actions part you have this code:

// Dependencies
const assert = require('assert');
(async () => {
  // New Nikita session
  var {status} = await nikita.call('./lib/touch')
  assert.equal(status, true)
})()

Using the code as it is does not work. As pointed out by Sergei we need to add a require statement for the path

// Dependencies
const assert = require('assert');
(async () => {
  // New Nikita session
  var {status} = await nikita.call(require('./lib/touch'))
  assert.equal(status, true)
})()

fbraza avatar Feb 10 '21 10:02 fbraza