aam229 / inquirer-path Goto Github PK
View Code? Open in Web Editor NEWAn inquirer extension to support path questions
An inquirer extension to support path questions
There are some common commands in bash and zsh that would be nice additions, e.g.
ctrl-a: move cursor to beginning of prompt
ctrl-e: move cursor to end of prompt
ctrl-w: delete the word immediately preceding the cursor
ctrl-u: delete the entire line to the left of the cursor
There are many others, but these are the ones I'm familiar with.. one wrinkle is that I think users can customize the shortcuts to access these commands :\
Trying to use it, I get:
$ babel-node index.js
module.js:474
throw err;
^
Error: Cannot find module 'babel-runtime/core-js/object/keys'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kristianmandrup/repos/generators/master-inquisitor/node_modules/inquirer-path/lib/PathPrompt.js:3:13)
When I look at the file node_modules/inquirer-path/lib/PathPrompt.js
Indeed, I don't have babel-runtime
in my project. I think your compilation surely should output ES5 files that are not reliant on babel runtime.
'use strict';
var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
var _assign = require('babel-runtime/core-js/object/assign');
var _assign2 = _interopRequireDefault(_assign);
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
In PathAutocomplete.js line 21
if (!this.cwd.isExistingDirectory()) { throw new Error(
The provided working directory ${cwd} does not exist or is not a directory.); }
then, the directoryOnly is meaningless; It should be:
if (!this.cwd.isExistingDirectory() && directoryOnly) { throw new Error(
The provided working directory ${cwd} does not exist or is not a directory.); }
Some times we hit tab several times (nervous fingers). Using arrow keys we can navigate back to selection.
I would be amazing if ~/
was recognised as the user's home directory
In this example, only the second line should query for a file, the fourth line is an anomaly not entered within the code. Whilst typing in, the third entry defaulted to containing the answer to the previous query, and when backspaced that still led to an invalid answer to the third query.
Configuration:
{
type: 'path',
name: 'file',
message: 'Which file would you like to parse?',
default: process.cwd(),
validate: (path) => {
if (fs.existsSync(path)) return true
return console.log(' <-- this path does not exist or is inaccesible.')
},
multi: false
}
I installed the babelruntime and I got this plugin working.
However, when I start inputting a path I dont get any suggestions.
When i press tab, it literally prints a tab charakter. So I wonder: how is this plugin different from a normal input?
Am I doing something wrong?
I use win7 64bit, ConEmu, node v8.1.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.