Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jun 02 2020 06:16
    @ljharb banned @frank-dspeed
  • Apr 27 2018 01:23
    @MylesBorins banned @fjeddy
  • Feb 24 2016 08:26
    @rvagg banned @jonathanenbe
I would just use bash I am not sure what your purpose is but it seems like your overcomplicating it and im not sure if java is the best route for a gui application.
Hi all, just to say I've joined this as a test: it works from element.io: https://matrix.org/blog/2020/12/07/gitter-now-speaks-matrix 🎉
1 reply
Alestor Aldous
new Date('Dec 31').toJSON().slice(5,10) getting "12-30"
Here's my code for variable value store when I run the code get the error in render variable in undefined I want to use var outside method : function processMessage(msg, seqno, headers) {
console.log("Processing msg #" + seqno);
        var parser = new MailParser();
        parser.on('headers', headers => {
            console.log('to2----', headers.get('to').text);
            console.log('from2----', headers.get('from').text);
            console.log('subject---', headers.get('subject'));
            console.log('date---', headers.get('date'));

            var sender = headers.get('to').text;
            var reciver = headers.get('from').text;   });

        parser.on('data', data => {
            if (data.type === 'text') {
                console.log('msg---', data.text);  /* data.html*/

        msg.on('body', function (stream) {
            stream.on('data', function (chunk) {

        msg.once('end', function () {

     res.render('email-reply', { title: 'Email Reply', to: sender, from: reciver });

Hi, I am new to Node , I have created a node server which prints to a Star receipt printer fine for both USB and WIFI when run on Windows however, when I run it on a Mac version 10.13.3 the WIFI works fine but USB does nothing, the data gets to the printer queue ok but then just dissappears into the ether. On windows I use the thermal-printer module ( built from source ) which works great, but on MAC ( again built from source ) the USB does nothing so I tried the node printer module ( also built from source ) and still nothing.
var CD_INITIALIZE = Buffer.from([ 0x1b, '@']);
var CD_KICK       = Buffer.from([0x1b, 0x07, 0x0b, 0x37, 0x07]);
var CD_FONT       = Buffer.from([0x1b, 0x1e, 0x46, 0x00]);
var CD_BOLD       = Buffer.from([0x1b, 0x45 ]);
var CD_NORMAL     = Buffer.from([0x1b, 0x46 ]);
var CD_CUT        = Buffer.from([0x1b, 0x64, 0x30]);

//var deviceName = '_192_168_1_106';
var deviceName = 'Star_TSP143__STR_T_001_';

var message    = "\nDaffodil              10.00\nTulips                23.00\n"
var shopHeader = "Flowers\nBy\nDavid";

const printer = require('printer');

printRaw( CD_INITIALIZE, deviceName );
printRaw( CD_FONT, deviceName );
printRaw( CD_BOLD, deviceName );
printText( shopHeader , deviceName );
printRaw( CD_NORMAL, deviceName );
printText( message , deviceName );
printRaw( CD_CUT, deviceName );

function printRaw( data, printerName ) {
        data:    data,
        printer: printerName,
        type:    'RAW',
        success: function( jobId ) {
            console.log("Print RAW completed OK");
        error: function( err ) {
            console.log("Print RAW error [" + err + "]");

function printText( data, printerName ) {
        data:    data,
        printer: printerName,
        type:    'TEXT',
        success: function( jobId ) {
            console.log("Print TEXT completed OK");
        error: function( err ) {
            console.log("Print TEXT error [" + err + "]");

Siemienik Pawel

I've released the alpha version of spreadsheet files importer cli: sxi. More details may be found on the package readme:

(xlsx-import-cli is part of XToolset - set of high level api tools for XLSX files).

Any feedback welcomed, any stars loved :heart: .

1 reply
Jordan Harband
how does xtoolset differ from sheetjs
Hi, I am trying to run a NODE server as a windows service but when I try to start it I get error 1053, it does not respond in a timely manner. I have checked all the suggestions provided by MS including setting ServicesPipeTimeout value in registry but still same error, my bat script is as follows:
@echo off
set STS_HOME=d:\TerminalServer
set NODE_HOME=d:\Node
del %STS_HOME%/log/sts.log
start /b %NODE_HOME%\node "%STS_HOME%\terminalServer.js" > %STS_HOME%/log/sts.log
Found this which worked really well npm install -g qckwinsvc,
Michael Carleton

I'm trying to port this js to java

if (cells[i0] & W && distance[i1 = i0 - 1] === undefined) distance[i1] = d, frontier1.push(i1);

i1 is reassigned during the array reference -- what does the value of i1 in distance[i1] take?
the new val or old val?
Cells[i0] and W are both numbers, so "cells[i0] & W" performs a bitwise AND, then the "&&" evaluates the truthy of this, where only the number 1 is true -- is this correct?

Covenant Simon
Hi am fairly new to nodejs and am currently working on a project
Shekhar Ramola
how do I fix this error?
I kept getting this when running a function
it is a huge operation I am doing
there are a lot of records which i am saving in the data base
Rob Simpson
Hello everyone. This is my first time in here. Wanted to say hi
Erik Kralj
Hello everyone
G. Szabi
Yousef Amar
Hi all from Matrix!
Hi everyone!
Can anyone help me? Does anyone know how to set the hash of a crypto.Hash object?
I have a sha256 hex string as input and need to convert it into such object
Greetings from the Matrix 😀
Yes hello! Tank cut the hard line and here we all are
Jakub Barczyk
I've written a short poem for all the Node people out there... ehm!
Matrix is green and so is Node
I can't express how I love to code!

Guilherme C. Souza

Hi, everyone! I don't mean to annoy you. Would you help me answering a few (9) simple questions about your dev env setup?
Very much appreciated!

Also, let me know if by any chance this is agains the rules.

Rajpal Chauhan

Hi All,

Can someone please help me to write a synchronized function in Node.

What I want, when multiple request trying to access same function it should be locked for one until the data has not been processed within that function.

Here is the my code:

You should use the callback function to do that
Rajpal Chauhan
Hi @NikitaBazhenovb,
Nope it is not in that case too
um, could you please let me know more correctly?
in my case , it works using callback function
First, you need to make callback function and in it, you should use the functions.
Rajpal Chauhan
const updateData = async (index: number): Promise<void> => {
const currentVersion = await getCurrentVersion();
const latestVersion = currentVersion + 1;
const s3FileName = "file_" + latestVersion + ".pdf";
const seResult = await uploadFileToS3(currentVersion, s3FileName);
console.log("S3 Result", seResult)
console.log("RequestNumber: ", index, ", LastVersion: ", currentVersion, ", LatestVersion: ", latestVersion);
app.get('/test', makecallback(controller)
and in controller you should define the response code.
Rajpal Chauhan
Ahhh, I hear you
does that make sense?
Rajpal Chauhan
Let me check and back to you
Rajpal Chauhan
@NikitaBazhenovb Thanks for your help
Rajpal Chauhan

Hi @NikitaBazhenovb,
Can you please gimme a example please.

I'm little bit confused how to use it.

yeah,,, could you let me know your source project?
Rajpal Chauhan
Yes, sent you in private chat