本文最后更新于:2024-11-18T14:20:10+08:00
Build faster with Bun.
官网: https://bun.sh/
简介 Develop, test, run, and bundle JavaScript & TypeScript projects—all with Bun. Bun is an all-in-one JavaScript runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager.
环境搭建 Mac、Linux or WSL curl -fsSL https://bun.sh/install | bash
Windows + Docker docker pull oven/bun
#绑定了当前路径,可以直接运行当前路径下的代码
docker run --rm --init --ulimit memlock=-1:-1 -v "${PWD}:/home/bun/app" oven/bun
举一反三
类似这样的Docker环境,我们都可以用这种方式来实现无需安装即可完成环境的搭建部署 例如Python:
docker pull python:3.9.17
docker volume create pip-cache
docker run --rm --init --ulimit memlock=-1:-1 -v pip-cache:/root/.cache/pip -v "${PWD}:/usr/src/app" -w /usr/src/app python:3.9.17 pip install -r ./requirements.txt
docker run --rm --init --ulimit memlock=-1:-1 -v pip-cache:/root/.cache/pip -v "${PWD}:/usr/src/app" -w /usr/src/app python:3.9.17 python demo.py
Nice!效果极佳!赞👍