npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remult-cli

v0.5.3

Published

<div align="center"> <img src="https://raw.githubusercontent.com/Yedidyar/remult-cli/main/assets/logo.png" width="200" height="200"> <h1>Remult CLI</h1>

Downloads

6

Readme

remult-cli is a command-line tool designed to simplify the process of generating Remult entities from a PostgreSQL database.

Inspired by prisma db pull, this tool streamlines the creation of Remult entities, making database integration smoother and more efficient.

Usage

Basic Usage

Generate Remult entities using the default settings:

npx remult-cli pull

Advanced Usage

For more advanced usage, you can utilize the --help flag to explore the available options:

npx remult-cli --help

Examples

# All entities from two schemas:
npx remult-cli pull --schemas auth public

# All entities from all schemas:
npx remult-cli pull --schemas '*'

Options

  • --connectionString: Your PostgreSQL database connection string. Only PostgreSQL databases are supported.
  • --tableProps: Customize properties for generated tables (default: allowApiCrud: true).
  • --output: Define the output directory for the generated Remult entities (default: ./src/shared).
  • --defaultOrderBy: Will put a default order by if we see one of this column name. (default: order,name).
  • --customDecorators: Will replace the default decorator by a custom one. (Should be a stringified JSON object). Let's describe this example: {"@Fields.string":"@KitFields.string#@kitql/remult"}, here we replace the default @Fields.string decorator by @KitFields.string from the @kitql/remult import.

Environmental Variables

Alternatively, you can utilize a .env file to set configuration values. Example:

DATABASE_URL=postgres://user:pass@host:port/db-name
TABLE_PROPS=allowApiCrud: (r) => r?.authenticated() ?? false
OUTPUT=./fancy/place
DEFAULT_ORDER_BY = "order,name,nom,username"
CUSTOM_DECORATORS = '{"@Fields.string":"@KitFields.string#@kitql/remult","@Fields.dateOnly":"@KitFields.dateOnly#@kitql/remult"}'

After setting up your .env file, run the following command:

npx remult-cli pull

Development

  1. Clone the repository:
git clone https://github.com/Yedidyar/remult-cli.git
  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev
  1. Begin development:
pnpm start
  1. Run CI locally with 🌍 earthly 🌍
    • Install earthly for yours OS (you can see there yours OS pre-requisites)
    • Run earthly -P +all (you can also add the --interactive flag for debugging)

Contribution

We welcome contributions from the community! If you find any issues or have ideas for enhancements, please submit bug reports, feature requests, or pull requests through our GitHub repository.

License

remult-cli is licensed under the MIT License.