open-index/open-npm huggingface dataset:
npm package: @harryhope/eslint-config-hh
Description: An eslint configuration for the style of javascript I like to write
Author: Harry Hope
Latest version: 1.1.1

# eslint-config-hh
An eslint configuration for the style of javascript I like to write. It's based on [standard](https://standardjs.com) with some additional rules that I believe makes code more readable.

## Installation
```
npm i -D eslint-plugin-promise eslint-plugin-standard eslint-plugin-node eslint-plugin-import eslint-config-standard
npm i -D @harryhope/eslint-config-hh
```

## Usage
Documentation on [sharable configs](http://eslint.org/docs/developer-guide/shareable-configs) can be found on the eslint docs.

Details on [standard](https://github.com/feross/eslint-config-standard) can be found here.
npm package: @harryhope/fdeploy
Description: A CLI for deploying AWS Lambda functions
Author: Harry Hope
Latest version: 1.2.0

# fdeploy
A simple CLI-tool for deploying Lambdas.

## Usage
```
fdeploy <command>

Commands:
  fdeploy lambda  Deploy a lambda function to AWS                   [aliases: l]

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]
```

To use `fdeploy`, open a terminal window in your Lambda function's folder.

`fdeploy` uses [dotenv](https://www.dotenv.org) to read AWS keys from your project's folder. By default it will read `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` environment variables. They must corrispond to an IAM key that has Lambda deployment access.

A simple deployment command may look like:
```
fdeploy lambda -n your-lambda-name
```

Running this command from a folder containing your Lambda's code will zip and upload the file to AWS and deploy it as a Lambda function named `your-lambda-name`.
npm package: @harryhope/messenger
Description: Simple pub/sub implementation for node and the browser
Author: Harry Hope
Latest version: 0.1.0

# messenger.js
A simple publish/subscribe implementation for node and the browser.

## Installation
Use:
```
npm i @harryhope/messenger
```

## Usage
```js
import messenger from '@harryhope/messenger'

messenger.on('myEvent', name =>
  console.log(`Hello there, ${name}`)
)

messenger.send('myEvent', 'Elvis')
```

## API

#### messenger.on
Subscribe to an event/topic with a callback function.
```js
const myCallback = str => console.log(`Hello ${str}`)
messenger.on('hello', myCallback)
```

#### messenger.off
Unsubscribe to an event.
```js
messenger.off('hello', myCallback)
```

#### messenger.send
Broadcast a message to all subscribers of an event.
```js
messenger.send('hello', 'world')
// Displays 'Hello world' in the console.
```

## Development
To build the src just run `npm run build`.

Tests can be run with `npm test`.
npm package: @harryhope/slate-react
Description: Tools for building completely customizable richtext editors with React.
Latest version: 0.60.4

This package contains the React-specific logic for Slate. It's separated further into a series of directories:

- [**Components**](./src/components) — containing the React components for rendering Slate editors.
- [**Hooks**](./src/hooks) — containing a few React hooks for Slate editors.
- [**Plugins**](./src/plugin) — containing the React-specific plugins for Slate editors.
- [**Utils**](./src/utils) — containing a few private convenience modules.

Feel free to poke around in each of them to learn more!
npm package: @harryhope/svgrim
Description: SVGR Improved. Reactify svgs with additional options.
Author: Harry Hope
Latest version: 0.2.0

# svgrim 🐅
SVGR Improved. Reactify svgs with additional options.

svgrim is a wrapper around [svgr](https://github.com/smooth-code/svgr) with additional features I use for compiling svg files into react js files. It currently features a more robust find/replace option, an option to create an index file with a list of ES6 icon exports, and defaults to converting a directory of svg icons while maintaining identical file naming conventions.

## Installation
To install globally, run
```
npm i -g @harryhope/svgrim
```

## Usage
```
  Usage: svgrim [options]

  SVGR Improved. Reactify svgs with additional options.

  Options:

    -V, --version           output the version number
    -d, --dir [value]       A directory of svgs to convert (default: ./)
    -r, --replace <values>  strings to replace
    -w, --with <values>     values to replace --replace with
    --icon                  use "1em" as width and height and add viewbox
    --ext <ext>             specify a custom file extension (default: "js")
    --no-dimensions         remove width and height from root SVG tag
    --native                add react-native support with react-native-svg
    --ref                   add svgRef prop to svg
    --title-prop            create a title element linked with props
    --create-index          create an index file with ES6 export syntax
    -h, --help              output usage information
```
npm package: @harrylowkey/code2image
Description: Generate image from code
Author: harrylowkey.tech@gmail.com
Latest version: 0.0.29

# Code2Image

Generate image from code

## Description

This repo has been rebuilt based on [code2img](https://github.com/cyberpirate92/code2img)

## Installation

```bash
$ npm i @harrylowkey/code2image
$ npm i mkdir
$ npm i ncp
```

## Usage

Import Code2ImageModule in your Nest application.

```typescript
import { Module } from '@nestjs/common';
import { Code2ImageModule } from '@harrylowkey/code2image';

@Module({
  imports: [ Code2ImageModule.forRoot({ host: 'http://localhost:3000' || 'your backend url' }) ]
})
export class ApplicationModule {}
```

Import ServeStaticModule in your Nest application.

```typescript
import { ServeStaticModule } from '@nestjs/serve-static';
import { Module } from '@nestjs/common';
import { join } from 'path';

@Module({
  imports: [
    ServeStaticModule.forRoot({
        rootPath: join(__dirname, '..', 'public'),
        serveRoot: '/'
    })
  ]
})
export class ApplicationModule {}

```

Add the copy-code2image-public script in `package.json` to copy the code2image public director to your build folder.
Update the build/start:dev/start:debug script to use the copy-code2image-public script.

```json
"scripts": {
    "copy-code2image-public": "mkdirp dist/public && ncp node_modules/@harrylowkey/code2image/public dist/public",
    "build": "npm run copy-code2image-public && nest build",
    "start:dev": "npm run copy-code2image-public && nest start --watch",
    "start:debug": "npm run copy-code2image-public && nest start --debug --watch",
}
```

Inject the Code2ImageService in your Nest application.

```typescript
import { Injectable } from '@nestjs/common';
import { Code2ImageService, LanguageEnum, ThemeEnum, GenerateImagePramType } from '@harrylowkey/code2image';

@Injectable()
export class PostBuilderService implements PostBuilderInterface {
    constructor(private code2ImageService: Code2ImageService) {}

    #randomLanguage(): LanguageEnum {
        const languages = Object.values(LanguageEnum);
        return languages[Math.floor(Math.random() * languages.length)];
    }

    #randomTheme(): ThemeEnum {
        const themes = Object.values(ThemeEnum);
        return themes[Math.floor(Math.random() * themes.length)];
    }

    async generateImage(): string {
        const params: GenerateImagePramType = {
            code: 'console.log("Hello World")',
            theme: this.#randomTheme(),
            language: this.#randomLanguage(),
        };
        const image = await this.code2ImageService.generateImage({ ...params, code })
    }
```

## Example
To learn more about the usage of this package, visiting: [instagram-coding-easily-api](https://github.com/harrylowkey/instagram-coding-easily-api)
npm package: @harryneo/seoai
Description: AI-driven metadata injector for static sites (HTML)
Latest version: 0.1.1

@harryneo/seoai — AI-driven metadata injector for static sites

Usage
- Install: `npm i -D @harryneo/seoai` or `npm i -g @harryneo/seoai`
- Env: set `OPENAI_API_KEY` (and optional `OPENAI_BASE_URL`)

CLI
`seoai --in ./dist --base https://example.com --siteName "Example" --author "Ops" --defaultImage /og.jpg --lang zh-CN --force --backup --verbose`

API
`import { processDirectory } from '@harryneo/seoai';
await processDirectory({ inDir: './dist', base: 'https://example.com', siteName: 'Example', author: 'Ops', defaultImage: '/og.jpg', lang: 'zh-CN', type: 'Article', maxDesc: 160, force: true, backup: true, dryRun: false, verbose: true, concurrency: 4 });`

Notes
- Adds title/description/OG/Twitter/canonical/JSON-LD and html lang.
- Falls back to heuristics if AI fails. Use `--dryRun` to preview.
npm package: @harrysarson/eval-debug
Description: Wrapper around debug that allows conditional evaluation for performance reasons
Author: Harry Sarson
Latest version: 0.0.1

# eval-debug

A wrapper around [debug](https://github.com/visionmedia/debug/) if you are worried about the 
performance penalty of creating logging data in production mode.

## usage

```js

const createDebug = require('harrysarson/eval-debug');

const debug = createDebug('namespace');

debug('%e', expensiveFunction);

// will log the return value of expensiveFunction(). 
// expensiveFunction() will not be called unless debug is enabled


```

## warning

Conditionally running code dependant on whether or not debugging is enabled is an anti-pattern.
This could lead to errors in production code that disapear when you try to debug them causing 
everyone involved a lot of grief.

See https://github.com/visionmedia/debug/pull/497.