learn by doing
wobsoriano / bun-promptx Goto Github PK
View Code? Open in Web Editor NEWTerminal prompt library for the Bun runtime
License: MIT License
Terminal prompt library for the Bun runtime
License: MIT License
learn by doing
const responses = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((item) => {
return createSelection(
[
{
text: 'skip',
},
{
text: 'higher',
},
{
text: 'lower',
},
],
{
headerText: `What should be done with number: ${item}?`,
}
)
})
console.log(responses)
If I enter the command [CTRL] + [C]
, it doesn't exit the running process as expected.
Instead, it continues throughout the list of items.
I got an error:
9 | filename = `../release/promptx-${platform}-amd64.${suffix}`;
10 | } else {
11 | filename = `../release/promptx-${platform}-${arch}.${suffix}`;
12 | }
13 | var location = new URL(filename, import.meta.url).pathname;
14 | var { symbols } = dlopen(location, {
^
ERR_DLOPEN_FAILED: Failed to open library. This is usually caused by a missing library or an invalid library path.
syscall: "dlopen"
at bun:ffi:61:41
at D:\Code\Whatever\example.com\node_modules\bun-promptx\dist\index.mjs:14:19
On Windows 11 with Powershell 7.
My script was simple:
import { mkdir } from "node:fs/promises";
import { createPrompt } from 'bun-promptx'
const title = createPrompt("Enter title: ")
const tags = createPrompt("Enter tags: ")
const metadata = `---
title: '${title}'
date: '${new Date()}'
tags: [${tags}]
draft: true
---
`
const dir = "path/to/dir"
await mkdir(dir, { recursive: true });
await Bun.write(`${dir}/index.md`, metadata);
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.