open-index/open-npm huggingface dataset:
npm package: @poindexter.json/codewars-cli
Description: Codewars CLI parses a user's codewars solutions and outputs them in a github README.md format
Author: Jason Poindexter
Latest version: 1.0.6

# codewars-cli
https://www.npmjs.com/package/@poindexter.json/codewars-cli

Codewars CLI parses a user's codewars solutions and outputs them in a github README.md format.

```bash
Options:
      --help      Show help                                             [boolean]
      --version   Show version number                                   [boolean]
  -u, --username  Username or ID of the codewars user                   [string] [required]
  -t, --token     'remember_user_token' value from codewars cookie      [string] [required]
  -f, --filename  Filename to output codewars solutions as markdown     [string] [default: "README.md"]

```

[Example output](https://github.com/jsonpoindexter/codewars-solutions/blob/master/README.md)

## Quick Overview
```bash
npx @poindexter.json/codewars-cli --username=*codewars username or ID* --token=*remember_user_token from codewars cookie*
```
example:
```bash
npx @poindexter.json/codewars-cli --username=jsonpoindxter --token=BAhbCFsGSSIdN...
```

## Codewars Token
The codewars 'remember_user_token' is required in order to fetch a user's solutions since [the codewars API or UI does not  currently allow this](https://github.com/Codewars/codewars.com/issues/235). The 'remember_user_token' is created after a succesful login to codewars and stored in the web browsers cookies.

[How to view cookies](https://www.cookieyes.com/how-to-check-cookies-on-your-website-manually/)
npm package: @point-hub/express-cli
Description: Express command line interface wrapper
Author: Martien Dermawan Tanama
Latest version: 0.2.2

# Express Cli

> This is an Express ESM-only module library - you are not able to import it with `require()`.

## Install

```bash
npm install @point-hub/express-cli
```

## Directory Example

```
•
├── bin
│   └── cli.js
├── lib
└── src
    ├── commands
    │   └── example-command.ts
    └── index.ts
```

## Usage Example

1. create command file `src/commands/greet-command.ts`

```ts
import { BaseCommand } from "@point-hub/express-cli";

export class GreetCommand extends BaseCommand {
  constructor() {
    super({
      name: "greet",
      summary: "Welcome someone",
      description: "Welcome someone with particular words",
      alias: ["gret", "say"],
      arguments: [
        {
          name: "name",
          description: "Your name",
        },
      ],
      options: [
        {
          type: "boolean",
          flag: "--smile",
          shorthand: "-s",
          description: "Add smiley :)",
        },
      ],
    });
  }
  handle() {
    // handle command here
  }
}

```

2. create an entry point file `src/ìndex.ts`

```ts
import { ExpressCli } from "@point-hub/express-cli";
import { GreetCommand } from "./commands/greet.command.js";

/**
 * Register the commands for the application.
 *
 * @example
 * command.register(ExampleCommand);
 */
export function commands(command: ExpressCli): void {
  command.register(new GreetCommand());
}
```

3. compile typescript to `"lib"` directory

4. create an executeable file `bin/cli.js` and make it executeable `chmod +x bin/cli.js`

```js
#!/usr/bin/env node

import { commands } from "../lib/index.js";
import { ExpressCli } from "@point-hub/express-cli";

const cli = new ExpressCli("cli");
commands(cli);
cli.run(process.argv);
```

5. try your command using `node bin/cli.js greet John`
npm package: @point-hub/express-error-handler
Description: Express error handler
Author: Martien Dermawan Tanama
Latest version: 0.2.2

# Express Error Handler

It is not hard to see that some people are struggling to handle errors, and some are even totally missing it. Handling errors properly means not only reducing the development time by finding bugs and errors easily but also developing a robust codebase for large-scale applications.

## Types of Errors in Node.js

First of all, it is necessary to have a clear understanding of errors in Node.js. In general, Node.js errors are divided into two distinct categories.

- **Operational errors** represent runtime problems whose results are expected and should be dealt with in a proper way. Operational errors don’t mean the application itself has bugs, but developers need to handle them thoughtfully. It means they need to be handled properly. Here’s a list of common operational errors:
  - Failed to connect to a database server.
  - Invalid inputs by the user.
  - Request timeout.
  - Resource not found (server responds with a 404 response code).

- **Programmer errors** represent unexpected bugs in poorly written code. They mean the code itself has some issues to solve and was coded wrong. A good example is to try to read a property of “undefined.” To fix the issue, the code has to be changed. That is a bug a developer made, not an operational error.
  - Trying to read a property on an object that is not defined.
  - Invoking or calling an asynchronous function without a callback.
  - Passing a string where a number was expected.
npm package: @point-hub/express-factory
Description: Express factory
Author: Martien Dermawan Tanama
Latest version: 1.1.4

# Express Factory

`@point-hub/express-factory` is an ESM-only module - you are not able to import it with `require()`.

Express model factories make it painless to create test database record using your application

## Installation

```javascript
npm install @faker-js/faker @point-hub/express-factory --save-dev
```

## Usage

Create a factory file and implement your model definition, create, and createMany methods

```javascript
import { faker } from "@faker-js/faker";
import Factory from "../index.js";
import { UserInterface } from "./user.model.js";
import UserService from "./user.service.js";

export default class UserFactory extends Factory<UserInterface> {
  definition() {
    return {
      name: faker.name.findName(),
      age: faker.datatype.number({
        min: 15,
        max: 50,
      }),
    };
  }

  async create() {
    return await new UserService().create(this.makeOne());
  }

  async createMany(count: number) {
    return new UserService().createMany(this.makeMany(count));
  }
}

```

Use your factory in your test file

```javascript
// Create one user
new UserFactory().create();

// Create many users
new UserFactory().createMany(3);
```

## Features

### Make
Use the make method to create models without persisting them to the database
```javascript
// Make one user without saving to database
new UserFactory().makeOne();
// Alias
new UserFactory().make();

// Make many users without saving to database
new UserFactory().makeMany(3);
// Alias
new UserFactory().make(3);
```

### Sequences
Sometimes you may wish to alternate the value of a given model attribute for each created model. You may accomplish this by defining a state transformation as a sequence.

```javascript
const userFactory = new UserFactory();
userFactory.sequence([
  { name: "John" },
  { name: "Jane" },
]);
userFactory.createMany(3);
```

### State
State manipulation allow you to define discrete modifications that can be applied to your model factories in any combination.

```javascript
const userFactory = new UserFactory();
userFactory.state({
  age: 21,
});
userFactory.create();
```
npm package: @point-hub/google-maps-api
Description: Google Map API promise
Latest version: 1.0.0

# Vue 3 Google Maps API

Provides a convenient wrapper for the Google Maps API, allowing it to be called in the promise syntax.

## Installation

```
npm install --save @point-hub/google-maps-api

or

yarn add @point-hub/google-maps-api
```

## Usage
1. Get your API key from Google
[https://developers.google.com/maps/documentation/javascript/get-api-key](https://developers.google.com/maps/documentation/javascript/get-api-key)

2. Use it in your app
```
var GoogleMapsApi = require('@point-hub/google-maps-api');

GoogleMapsApi({
  libraries: ['places'],
  apiKey: 'replace-this-with-your-api-key'
})
.then(function(googleApi) {
  var autocomplete = new googleApi.maps.places.AutocompleteService();
}, function(err) {
  console.error(err);
});
```
npm package: @point-hub/nodemailer-inlinecss
Description: A Nodemailer plugin for inlining CSS
Author: Martien Dermawan Tanama
Latest version: 1.0.2

# Nodemailer Inlining CSS
`@point-hub/nodemailer-inlinecss` is an ESM-only module - you are not able to import it with `require()`.

## Install

Install from npm

    npm install @point-hub/nodemailer-inlinecss

## Usage 
### Internal Styles
```javascript
import { createTransport } from "nodemailer";
import { PluginFunction } from "nodemailer/lib/mailer";
import inlineCss from "@point-hub/nodemailer-inlinecss";

var transporter = nodemailer.createTransport();
transporter.use('compile', inlineCss() as PluginFunction);
transporter.sendMail({
    from: '...',
    to: '...',
    html: '<style>div { color:black; }</style><div>Hello world</div>'
});
```

Will result in an email with the following HTML:

    <div style="color: black;">Hello world</div>

### External Styles
```javascript
import fs from "fs";
import { createTransport } from "nodemailer";
import { PluginFunction } from "nodemailer/lib/mailer";
import inlineCss from "@point-hub/nodemailer-inlinecss";

var transporter = nodemailer.createTransport();
transporter.use('compile', inlineCss({
    extraCss: fs.readFileSync("./src/styles.min.css").toString(),
}) as PluginFunction);
transporter.sendMail({
    from: '...',
    to: '...',
    html: '<div>Hello world</div>'
});
```
Your external css file.

```css
div {
  color: black;
}
```

Will result in an email with the following HTML:

    <div style="color: black;">Hello world</div>
npm package: @point-hub/papi-cli
Description: Papi CLI is a command line interface tool that helps you to initialize, develop, and maintain your Papi applications
Author: Martien Dermawan Tanama
Latest version: 0.0.3

## Description

The Papi CLI is a command line interface tool that helps you to initialize, develop, and maintain your Papi applications

## Installation

```bash
npm install -g @point-hub/papi-cli
```

## Usage
```bash
papi create <name>
```