Lightweight, beautiful and user-friendly interactive CLI prompts
prompts Zero dep, promise based, unifined CLI prompt.
Get it:npm install prompts
Sample usage:
12345678910111213141516
constprompts=require('prompts');letquestions=[{type:'text',name:'dish',message:'Do you like pizza?'},{type:prev=>prev=='pizza'?'text':null,name:'topping',message:'Name a topping'}];letresponse=awaitprompts(questions);
API:
12345678910111213141516171819
prompts(prompts,options);/*prompts:Type: Array|Objectoptions: onSubmit or onCancel functions.prompt object properties:{ type: String || Function, name: String || Function, message: String || Function, initial: String || Function || Async Function format: Function || Async Function, onState: Function}*/
lazy-cache uses native, plain-vanilla, tried and true javascript getters to call node's require() system for faster and safer code. (~1second to 50milliseconds)
Handle Force Touch, 3D Touch, and Pointer Pressure on the web.
Devices implement force differently pressure is trying to solve it across all devices, with polyfill and multi touch support.
Get it:npm install pressure
Sample usage:
123456789101112131415161718192021222324
constPressure=require('pressure');Pressure.set('#element',{start:function(event){// this is called on force start},end:function(){// this is called on force end},startDeepPress:function(event){// this is called on "force click" / "deep press", aka once the force is greater than 0.5},endDeepPress:function(){// this is called when the "force click" / "deep press" end},change:function(force,event){// this is called every time there is a change in pressure// force will always be a value from 0 to 1 on mobile and desktop},unsupported:function(){// NOTE: this is only called if the polyfill option is disabled!// this is called once there is a touch on the element and the device or browser does not support Force or 3D touch}});
Below are the supported devices:
Microsoft Surface, Wacom Tablets (Device that supports pointer events)
iPhone 6s, iPhone 6s Plus, iPhone 7, iPhone 7 Plus
🙌 Give thanks to the open source maintainers you depend on! ✨
thanks picks up the "nearest" package.json / node_modules folder and fetch all the mainterners who are seeking donation and lists them all in a neat table with the donation URL.
Get it:npm install -g thanks
Usage:
12345678910111213
$ thanks --help
thanks - 🙌 Give thanks to the open source maintainers you depend on! ✨
Usage:
thanks <flags> [CWD] If CWD is omitted, then the current working directory is used. The "nearest" package.json / node_modules folder will be used.
Flags:
-v, --version Show current version
-h, --help Show usage information
graphql-request is a minimal GraphQL promise based client. It's perfect for small scripts or simple apps, it doesn't have a built-in cache and has no integrations for frontend frameworks.
Get it:npm install graphql-request
Sample usage:
12345678
import{request,GraphQLClient}from'graphql-request'// Run GraphQL queries/mutations using a static functionrequest(endpoint,query,variables).then(data=>console.log(data))// ... or create a GraphQL client instance to send requestsconstclient=newGraphQLClient(endpoint,{headers:{}})client.request(query,variables).then(data=>console.log(data))