jprichardson / node-suppose

Like UNIX Expect, but for Node.js.
MIT License
252 stars 28 forks source link

input stops randomly #6

Open lutzbickhardt opened 10 years ago

lutzbickhardt commented 10 years ago

When executing the "npm install" example the input hangs (on rPi and mac) at different but reproducable points (debug is to process.stdout):

mac (OS X10.6.8) -------->

npm init

... Press ^C at any time to quit. name: (ripper) awesome_package version: (0.0.0) 0.0.1 description: It's an awesome package man! entry point: (startRip.js) test command: npm test git repository: x keywords: awesome, cool author: JP Richardson license: (BSD-2-Clause) ^Cimac-27_lan:ripper bickhardt$ imac-27_lan:ripper bickhardt$ node --version v0.10.23

rPi ----------->

npm init

This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sane defaults.

See npm help json for definitive documentation on these fields and exactly what they do.

Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file.

Press ^C at any time to quit. name: (ripper) awesome_package version: (0.0.0) 0.0.1 description: It's an awesome package man! entry point: (testM.js) ^Cpi@raspberrypi2 ~/ripper $ node --version v0.10.22

Any ideas?

jprichardson commented 10 years ago

This typically doesn't mean that node-suppose isn't working, it's because npm init performs differently and changes all of the time. I find myself needing to update the example code just because npm init changes. Try to use it with a real life problem that you need to solve and if you run into issues, let me know.

Other than that, I'm going to use this issue as one of reference to come up with a new "showcase" example for node-suppose.

lutzbickhardt commented 10 years ago

Hi, other than the trivial user/password login for my davfs2-server I have no real world examples now.

However the problem I was really trying to solve is access to a DB, in this case the FreeDB music database. A program I use -morituri- retrieves the disc Id and other stuff for me but refuses to access the DB to retrieve all the info. This involves a 3-step communication in which I have to send some info (track identification), get some info back (genre and id) and then send this back again to retrieve the track titles.

From what I read in your README.md, I would miss the ability to extract values from the return string, in order to process them and send back something based upon that data to the server. Could I do it with node-suppose?

I have attached the nodeJS program with which I now retrieve the data. Feel free to have a look. (sorry if it looks like FORTRAN IV, it is all I learned ...).

Cordialement


Lutz BICKHARDT lutz@bickhardt.fr

23/25, av. L?opold II, F-75016 Paris, France Graumannsweg 42, D-22087 Hamburg, Germany

SKYPE: bickhardt +33 9 60405114 (telephone fixe ? Paris) +33 6 18386906 (portable francais/ French cell phone) +49 40 22758122 (Festnetz in Hamburg) +49 172 3846086 (deutsches Handy / German cell phone)


De : JP Richardson notifications@github.com Envoy? : lundi 16 d?cembre 2013 18:23 ? : jprichardson/node-suppose Cc : Bickhardt, Lutz Objet : Re: [node-suppose] input stops randomly (#6)

This typically doesn't mean that node-suppose isn't working, it's because npm init performs differently and changes all of the time. I find myself needing to update the example code just because npm init changes. Try to use it with a real life problem that you need to solve and if you run into issues, let me know.

Other than that, I'm going to use this issue as one of reference to come up with a new "showcase" example for node-suppose.

Reply to this email directly or view it on GitHubhttps://github.com/jprichardson/node-suppose/issues/6#issuecomment-30680268.

jprichardson commented 10 years ago

At this moment, the most you could do would be to "match" based upon a regex. However, allowing to match for a function that would pass in the current output from the program may yield for some interesting scenarios. (I didn't see your program attached... not sure that Github will attach from emails).