Bun-Scripty
Bun-Scripty is a package that allows you to define npm scripts in separate TypeScript files, adapted to work with Bun. This project is inspired by and based on scripty by Test Double.
Introduction
Bun-Scripty allows you to organize your npm scripts into separate TypeScript files, making them easier to maintain and manage. Instead of cluttering your package.json
with numerous script commands, you can create individual TypeScript script files for each command.
Installation
bun add bun-scripty
Usage
-
Create a scripts
directory in your project root (or customize the path, see Customizing Script Path).
-
Add your TypeScript script files in this directory. For example, scripts/test.ts
for a test
script.
-
Make your script files executable:
chmod +x scripts/test.ts
-
In your package.json
, use Bun-Scripty to run your scripts:
{
"scripts": {
"test": "bun-scripty"
}
}
Now, when you run bun run test
, Bun-Scripty will execute the scripts/test.ts
file.
Features
- Organize npm scripts into separate TypeScript files
- Support for nested directories
- Works seamlessly with Bun
- Customizable script path
Current Limitations and Future Plans
- Current Version: Bun-Scripty currently only supports TypeScript (.ts) files.
- Future Expansion: We plan to expand support to other languages in future releases, similar to the original scripty project.
Acknowledgements
This project is based on the excellent scripty package by Test Double. We'd like to express our gratitude for their solid script setup and structure, which served as the foundation for Bun-Scripty.
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.