open-index/open-npm huggingface dataset:
npm package: @mayajs/cli
Description: MayaJS CLI is a command line interface for MayaJS. Its primary purpose is to assist developers with building MayaJS projects. MayaJS CLI allows you to generate and serving MayaJS project as well as generate MayaJS files (e.g. controllers, services and mod
Author: Mark Anthony C. Ignacio
Latest version: 0.7.2

![mayajs-command](https://user-images.githubusercontent.com/12345233/166587837-2ba5efb1-6ea1-4f1e-9a1d-77caaf667d83.gif)

The MayaJS CLI is a command line interface for MayaJS. Its primary purpose is to assist developers with building MayaJS projects. MayaJS CLI allows you to generate and serving MayaJS project as well as generate MayaJS files (e.g. controllers, services and models).

# Table of Contents

- [Create](#new)
- [Generate](#generate)
- [Run](#serve)
- [Build](#build)

# Installation

In order to start using MayaJS CLI you need to install it globally.

> `npm install -g @mayajs/cli`

## CREATE

> new | n <directory>

Create a new MayaJS project. This will generate all the basic files and install all the necessary dependencies for your MayaJS Project.

### Usage

`maya new my-new-app` or `maya n my-new-app`

## GENERATE

> generate | g <component> <directory>

This will help you generate components inside your MayaJS project. You can generate controllers, sevices and models using this command.

### Usage

#### ROUTES

`maya generate route sample` or `maya g r sample`

#### CONTROLLER

`maya generate controller sample` or `maya g c sample`

#### SERVICE

`maya generate service sample` or `maya g s sample`

#### MODEL

`maya generate model sample` or `maya g m sample`

## RUN

> serve | s [options]

This will run your MayaJS project which listens on port `3333` by default. In case where port `3333` is already in use or you want to run it on a different port number, use `--port` to specify a different port.

### Usage

#### DEFAULT

`maya serve` or `maya s`

#### CHANGE PORT

`maya serve --port 4444` or `maya s -p 4444`

## BUILD

> build | b

This will build your MayaJS project to javascript that you can deploy to your prefered cloud hosting. The output files will be inside the `dist` folder.

### Usage

#### DEFAULT

`maya build` or `maya b`
npm package: @mayajs/mongo
Description: MayaJS Mongo decorators and modules
Author: Mark Anthony C. Ignacio
Latest version: 0.7.2

<p align="center"><img src="https://github.com/mayajs/maya/blob/main/logo.svg"></p>
<h1 align="center">Mongodb Module and Service</h1>

## Description

A MayaJS module and service that deals with Mongodb drivers. It uses `mongoose` as its core dependency to communicate with the database.

## Installation

```shell
npm i @mayajs/mongo
```

## Quick Start

MayaJS uses custom modules to add functionality on its core. You can use `MongoDbModule` and import in on any MayaJS module in your project.

```ts
import { MongoDbModule } from "@mayajs/mongo";
import { Schema } from "mongoose";

// Define schema for mongoose
const User = new Schema({
  name: String,
  email: String,
  password: String,
});

const mongodbOptions = {
  connectionString: "your-mongodb-connection-string",
  name: "your-collection-name",
  options: {
    // Any mongoose options can be used here
    // i.e. useUnifiedTopology: true, useNewUrlParser: true, useFindAndModify: false
  },
  schemas: [
    {
      name: "User", // Name of model
      schema: User, // Mongoose Schema
    },
    ,
  ],
};

@Module({
  imports: [MongoDbModule.forRoot(mongodbOptions)],
})
class CustomModule {}
```

## Usage

To use mongodb inside your controller you will need to import `MongoDbServices`. MongoDbServices provides set of functionality to access, manipulate and interact with mongodb.

### Accessing a Collection

MongoDbServices provides a `database` function to access a specific collection in mongodb.

```ts
import { MongoDbServices } from "@mayajs/mongo";

@Controller()
class UsersController {
  // Inject MongoDbServices in a controller
  constructor(private mongo: MongoDbServices) {}

  sample() {
    // Get specific collection in mongodb
    const db = this.mongo.database("your-collection-name");
  }
}
```

### Accessing a Model

To access a model you will need first the get the collection instance that we get from the above example. On the db instance you can access the `model` object like seen below.

```ts
sample() {
  // Get specific collection in mongodb
  const db = this.mongo.database("your-collection-name");

  // Get specific model instance
  const model = db.instance.model("your-model-name");
}
```

This model instance is based on [Mongoose Model](https://mongoosejs.com/docs/api/model.html). All of mongoose functionality is available for this model instance.

## Collaborating

See collaborating guides [here.](https://github.com/mayajs/maya/blob/master/COLLABORATOR_GUIDE.md)

## People

Author and maintainer [Mac Ignacio](https://github.com/macign)

## License

[MIT](https://github.com/mayajs/maya/blob/master/LICENSE)
npm package: @mayajs/sql
Description: MayaJS Sql Decorators and Modules
Author: Mark Anthony C. Ignacio
Latest version: 0.4.0

<p align="center"><img src="https://github.com/mayajs/maya/blob/master/maya.svg"></p>
<h1 align="center">SQL Decorators and Modules</h1>

## Installation

- Install Mayajs Sql plugin

```sh
npm i @mayajs/sql
```

- Install [Sequelize](https://sequelize.org/master/manual/getting-started.html). Mayajs uses sequelize as an ORM.

```sh
npm install --save sequelize
```

You'll also have to manually install the driver for your database of choice:

```
# One of the following:
$ npm install --save pg pg-hstore # Postgres
$ npm install --save mysql2
$ npm install --save mariadb
$ npm install --save sqlite3
$ npm install --save tedious # Microsoft SQL Server
```

## Sql

This will creates a MySql Database that will be consume on AppModule class. It accepts an object of settings for mysql connection. This database will be consume by Mayajs in compilation and automatically connects the database when the `start` function is called.

**Import**

```javascript
import { Sql } from "@mayajs/sql";
```

**Implementation**

```javascript
Sql({
  name: "database-name",
  options: {
    database: "sql-database",
    username: "sql-username",
    password: "sql-password",
    options: {
      host: "localhost",
      dialect: "mysql" /* one of 'mariadb' | 'postgres' | 'mssql' */,
    },
  },
  schemas: [
    sample, // Sequelize Schema here
  ],
});
```

Adding `Sql` on `App Decorator`

```javascript
import Sql from "./databases/sql";

@App({
  databases: [Sql],
})
export class AppModule {}
```

## Schema

An interface for table fields. Can be used when creating tables for type checking. Every Schema is an object of fields. Each field has its `type` and `options`.

**Import**

```javascript
import { Schema } from "@mayajs/sql";
```

**Implementation**

```javascript
import { DataTypes } from "sequelize";
import { SqlModel } from "@mayajs/sql";

const schema = {
  name: {
    type: DataTypes.STRING,
    allowNull: false,
  },
};

export default SqlModel("User", schema, {});
```

# Examples

Check out [live examples](https://github.com/mayajs/sample/crud/sql) for more info.

## Collaborating

See collaborating guides [here.](https://github.com/mayajs/maya/blob/master/COLLABORATOR_GUIDE.md)

## People

Author and maintainer [Mac Ignacio](https://github.com/Mackignacio)
npm package: @mayama/zeq
Description: A JavaScript library to help sequencing commands and event waiting
Author: MayamaTakeshi
Latest version: 4.23.0

# zeq

A JavaScript library to help sequencing commands and event waiting.

Tested with node v16.17.1, v19.6.0 and v21.2.0

Some of the samples will not work with older node versions although zeq itself should work fine with old node versions.