Generate

Let's get started by creating a new directory to work in.

mkdir count-characters
cd count-characters

Initialize codeblox and follow the prompt to generate codeblox.json

Enter text for input and number for output.

npm install -g codeblox-cli
codeblox init

Codeblox supports only JavaScript (Node.js) for now, with support for Python and Java coming soon. Open codeblox.js in your working directory and paste the following code.

Install the codeblox NPM package, which simply wraps your function.

npm install codeblox

codeblox.js

const codeblox = require('codeblox')

module.exports.default = codeblox((input, options, callback) => {
  callback(null, input.length)
})

That's it! You've just written your first code block. Now we just need to publish it.

results matching ""

    No results matching ""