Coder Social home page Coder Social logo

bun-utilities's Introduction

Hiya, I'm Jozef Steinhübl 👋

I'm a 15-year-old computer enthusiast and student. I mainly work on the backend and am self-taught. I'm an open-source software creator and love experimenting with different programming languages and frameworks, including TypeScript, Python (primarily for school), Java, Astro, and React, and a little bit of Lua, Go and Rust.

I've also worked with Linux, Docker, MySQL, Redis and more. If you want to reach me, you can do so through mail at [email protected] or on Discord (xhyrom, 525316393768452098). You can also take a look at my website and link tree.

ko-fi

👀 Quick Statistics

basic info streak
🔥 Used Languages
🏅 Achievements
Detailed

bun-utilities's People

Contributors

harryrabin avatar xhyrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

harryrabin iq-scm

bun-utilities's Issues

split utils

for example, if you want to import fs utils you should use: import { copyfile } from 'bun-utilities/fs'

rewrite

i need to rewrite this, because its mess now

`spawn` hangs on long-running process

As far as I can tell, there's no way to get spawn to act like node's spawn with stdout.

Code like the following, simply does not work (because tail -f never finishes, it's a long-running process):

const { spawn } = require('bun-utilities/spawn.js')

const child = spawn('tail', ['-f', 'access.log'])
console.log(child)

Bun version: 0.1.13

In node land, we would listen for events from stdout like so:

const { spawn } = require('child_process')
const child = spawn('tail', ['-f', 'access.log'])

child.on('close', code => { ... })
child.stdout.on('data', data => { ... })

NOTE: exec behaves the same way.

Cannot require module on M1 Pro

Running this snippet

import { exec } from 'bun-utilities'

const p = await exec(['echo', 'test']);
console.log(p.stdout)

Throws this error

bun-test on  master [✘!?] is 📦 v0.0.0 via  v18.4.0 
❯ bun ./test.ts
75 |           loadError = e
76 |         }
77 |         break
78 |       case 'arm64':
79 |         try {
80 |           nativeBinding = require('./bindings/bun-utilities.darwin-arm64.node')
                                     ^
 error: Cannot require module "./bindings/bun-utilities.darwin-arm64.node"
      at /Users/jeremy/tmp/bun-test/node_modules/bun-utilities/lib/index.mjs:80:34
      at /Users/jeremy/tmp/bun-test/node_modules/bun-utilities/lib/index.mjs:80:34

Screen Shot 2022-07-15 at 10 03 34 AM

Bun version 0.1.4

implement `os`

  • cpus
  • networkInterfaces
  • homedir
  • cachedir
  • tempdir
  • hostname
  • platform
  • arch
  • release
  • uptime
  • total_memory
  • free_memory
  • total_swap
  • free_swap

Marked = already released (0.2.0)

Node.js ESM does not work.

require is used inside of index.mjs, which makes it fail to load on node esm. I get that this is a bun-specific project, but it would still be nice to have it work on node, as it does seem to support it somewhat.

The following line can be used to get a require in a node esm setting, but this will break bun as it doesn't provide a createRequire:

const require = createRequire(import.meta.url);

Cross compilation

Hi, not really an issue. Just want to know if there's any way to ONLY download binary for user's OS?

I'm talking about this...

Screen Shot 2022-07-16 at 8 41 25 PM

Thank you!

Can't load bun-utilities, no error

Having some issues loading bun-utilities. For example, spawn doesn't appear to be anything.

const { spawn } = require('bun-utilities/spawn')
const child = spawn('tail', ['-f', 'access.log'])

TypeError: spawn is not a function. (In 'spawn("tail", ["-f", "access.log"])', 'spawn' is undefined)

And just to see if the module contains anything:

const bu = require('bun-utilities/spawn')
console.log(bu)

{ exec: undefined, spawn: undefined, execAndDontWait: undefined, spawnAndDontWait: undefined }

Just to ensure the correct bindings were installed, I see the node_modules/bun-utilities/bindings/bun-utilities.linux-x64-gnu.node file.

FWIW: nativeBinding appears to be empty (although, this could be irrelevant).

nativeBinding = require(nativeBindingPath)
console.log(nativeBinding)

{ }

System:

$ bun --version
0.1.11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.