promptsj

0.1.1 • Public • Published

the worst package ever. Simple extended prompt i use for running javascript and shell at the same time. Use it if you want.

Simple use case

npm install -g promptsj

in terminal execute: promptsj

You are presented with:
prompt =>
 
 
prompt =>
prompt =>= 1
prompt =>console.log(a)
1
prompt =>b = function() { console.log('hello world') } 
prompt =>b()
hello world
prompt =>
prompt =>wget http://google.com
prompt =>curl http://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
 
// Running node programs.
prompt =>cat example.js
console.log('hello world');
 
prompt =>
prompt =>node example.js
hello world
 
 
//running node bin programs for example benchget
prompt =>nab -20 -20 http://google.com
Running 20 requests with a concurrency of 20
 
Url to test: http://google.com
 
Group(1) took (215 ms) to Finish with (20) results!
 
All Tests finished in (216 ms)
There are 20 results
 
prompt =>
 
// New Feature
 
rompt =>
prompt =>//Now you can assign bash results to javascript, and interpolate javascript to bash
prompt =>//Currently only support for variables in global scop
prompt =>url = 'http://google.com'
prompt =>
prompt =>output = curl {url}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   219  100   219    0     0   1561      0 --:--:-- --:--:-- --:--:--  1564
 
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
 
prompt =>
prompt =>console.log(output)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   219  100   219    0     0   1561      0 --:--:-- --:--:-- --:--:--  1564
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
 
</BODY></HTML>
 
// New Feature
 
Now you the stderr and stdout or splittable on '|||'
 
prompt =>
prompt =>url = 'http://google.com'
prompt =>output = curl {url}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   219  100   219    0     0   2258      0 --:--:-- --:--:-- --:--:--  2281
 
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
 
prompt =>
prompt =>split = output.split('|||')
prompt =>
prompt =>err = split[0]
prompt =>out = split[1]
prompt =>inspect(err)
'  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n100   219  100   219    0     0   2258      0 --:--:-- --:--:-- --:--:--  2281\n'
prompt =>
prompt =>inspect(out)
'<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.com/">here</A>.\n\n</BODY></HTML>\n\n'

Readme

Keywords

Package Sidebar

Install

npm i promptsj

Weekly Downloads

1

Version

0.1.1

License

WhateverYouWant Licencse

Last publish

Collaborators

  • mhernandez