# NodeJs-based development

**URL:** <https://forum.cardano.org/t/nodejs-based-development/78714>\
**Category:** Misc Dev Talk\
**Created:** [9 October 2021 02:59 UTC](https://forum.cardano.org/t/nodejs-based-development/78714 "2021-10-09T02:59:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![namlleh](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@namlleh](https://forum.cardano.org/u/namlleh)\
**Post date:** [9 October 2021 02:59 UTC](https://forum.cardano.org/t/nodejs-based-development/78714/1 "2021-10-09T02:59:39Z")

</div>

Hi folks,

I’m developing a simple service for minting, transferring native tokens using NodeJS but don’t know which SDK or libraries to use. Can you suggest me some? I want basic functionalities like query UTXOs, choosing UTXOs based on output amount, creating and sending transaction, and minting native tokens (NFTs).

Thanks!!

---

<div class="post-metadata">

**Author:** ![DinoDude](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@DinoDude](https://forum.cardano.org/u/DinoDude)\
**Post date:** [9 October 2021 17:05 UTC](https://forum.cardano.org/t/nodejs-based-development/78714/2 "2021-10-09T17:05:59Z")

</div>

Cardano is primarily made with Haskell and there is no official support for JavaScript, NodeJS, etc.

This is the closest thing resembling the kind of SDK you’re looking for

> **[cardano-sdk](https://www.npmjs.com/package/cardano-sdk)**
>
> An SDK for interacting with the Cardano blockchain

Additional cursory search query on GitHub reveals a few other attempts at API wrappers

> **[Build software better, together](https://github.com/search?q=cardano%2Bjavascript&type=repositories)**
>
> GitHub is where people build software. More than 65 million people use GitHub to discover, fork, and contribute to over 200 million projects.

---

<div class="post-metadata">

**Author:** ![Cardano-Cal](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/cardano-cal/32/27737_2.png) [@Cardano-Cal](https://forum.cardano.org/u/Cardano-Cal)\
**Post date:** [9 October 2021 18:50 UTC](https://forum.cardano.org/t/nodejs-based-development/78714/3 "2021-10-09T18:50:04Z")

</div>

Hey,

Check out this blog post  
[Node.js: writing shell scripts](https://blog.cloudboost.io/node-js-writing-shell-scripts-using-modern-javascript-instead-of-bash-774e0859f965)

Here is their code:

> module.exports.exec = function (command, {capture = false, echo = false} = {}) {  
> command = command.replace(/\?\n/g, ‘’); // need to merge multi-line commands into one string
> 
> if (echo) {  
> console.log(command);  
> }
> 
> const spawn = require(‘child\_process’).spawn;  
> const childProcess = spawn(‘bash’, [‘-c’, command], {stdio: capture ? ‘pipe’ : ‘inherit’});
> 
> return new Promise((resolve, reject) =\> {  
> let stdout = ‘’;
> 
> ```
> if (capture) {
> childProcess.stdout.on('data', (data) => {
> stdout += data;
> });
> }
> 
> childProcess.on('error', function (error) {
> reject({code: 1, error: error});
> });
> 
> childProcess.on('close', function (code) {
> if (code > 0) {
> reject({code: code, error: 'Command failed with code ' + code});
> } else {
> resolve({code: code, data: stdout});
> }
> });
> 
> ```
> 
> });  
> };

Then you could call the cli commands like this:

> const addr = ’abcde’  
> await exec('cardano-cli query utxo --address ’ + addr);

You can even get the result back into a variable:

> const data = (await exec('cardano-cli query utxo --address ’ + addr)).data;

I havent tested this myself but it will hopefully put you on the right track

Good luck 👍🏼

---

<div class="post-metadata">

**Author:** ![namlleh](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@namlleh](https://forum.cardano.org/u/namlleh)\
**Post date:** [10 October 2021 09:24 UTC](https://forum.cardano.org/t/nodejs-based-development/78714/4 "2021-10-10T09:24:40Z")

</div>

Thank you @Cardano-Cal and @DinoDude.
