https://github.com/seaofvoices/npmwally
A command line utility to convert Luau npm packages to wally packages
https://github.com/seaofvoices/npmwally
luau package-manager roblox tool
Last synced: 6 months ago
JSON representation
A command line utility to convert Luau npm packages to wally packages
- Host: GitHub
- URL: https://github.com/seaofvoices/npmwally
- Owner: seaofvoices
- License: mit
- Created: 2024-09-30T01:59:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-02T15:10:39.000Z (over 1 year ago)
- Last Synced: 2025-09-29T16:44:17.367Z (9 months ago)
- Topics: luau, package-manager, roblox, tool
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/seaofvoices/npmwally/actions/workflows/test.yml)

[](https://github.com/luau-lang/luau)


[](https://ko-fi.com/seaofvoices)
# npmwally
**npmwally** is a command-line tool that automates the conversion of a Lua/Luau npm package into a [Wally](https://github.com/UpliftGames/wally) package.
## Features
- **Package Detection:** Scans the `package.json` and identifies Lua/Luau dependencies.
- **Dependency Translation:** Maps npm package names to their wally equivalents.
- **Module Requires Conversion:** Runs darklua to convert the string/path requires into Roblox requires.
- **Generate a Wally Package:** Generate a `wally.toml` and a `default.project.json`. Remove files as specified in the `.npmignore` configuration file.
## Requirements
When converting packages, **npmwally** will run [Rojo](https://github.com/rojo-rbx/rojo) and [darklua](https://github.com/seaofvoices/darklua). Make sure to have those installed.
## Usage
You can install `npmwally` with npm or yarn:
```bash
npm install npmwally --save-dev
yarn add npmwally -D
```
### Convert a Package
To convert an npm package to a Wally package, use the `convert` command:
```bash
npmwally convert --output
```
For more information about the available options, use the `--help` argument:
```bash
npmwally convert --help
```
#### Example
```bash
npmwally convert --use-find-first-child
```
This command will:
- convert the Lua/Luau code the current working directory to a Wally package in './wally`.
- convert requires using `FindFirstChild` indexing.
### Options
- `--project `: The folder where the `package.json` file exists (default is the current directory).
- `--output `: The folder where the Wally package will be generated (default is `wally`).
- `--modules-folder `: The folder where npm packages are installed (default is `node_modules`).
- `--translate-package `: A package name to translate from npm to Wally format (`npm-package=wally-package`).
- `--copy `: Additional files or directories to copy into the Wally package.
- `--darklua-config `: Path to a custom Darklua configuration file.
- `--use-find-first-child`: Use `FindFirstChild` instead of direct indexing in generated requires.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for details.