open-index/open-npm huggingface dataset:
npm package: @richkang/cdk-construct-best-practices-config-conformance
Description: A conformance pack is a collection of AWS Config rules and remediation actions that can be easily deployed as a single entity in an account and a Region or across an organization in AWS Organizations.
Author: Richard Kang
Latest version: 0.1.6

# CDK Construct to create AWS Config Conformance Pack for common best practices

A conformance pack is a collection of AWS Config rules and remediation actions that can be easily deployed as a single entity in an account and a Region or across an organization in AWS Organizations.

This CDK Construct included some Conformance Pack for best practices with Config managed rules.

## Conformance Pack

### RDS Best practices

Subset of security best practices for Amazon RDS Conformance Packs. Full set of the rules can be found in [AWS Config github repository](https://github.com/awslabs/aws-config-rules/blob/master/aws-config-conformance-packs/Security-Best-Practices-for-RDS.yaml).

#### RDS_INSTANCE_PUBLIC_ACCESS_CHECK
Make sure the RDS is in the isolated subnet [1].

#### RDS_STORAGE_ENCRYPTED
RDS has encryption of data at rest [2].

### Example usage

Conformance Pack Name: `CdkConstructSecuredResourcesConfig.rdsBestPracticesComformancePack`

```
const config = new CdkConstructSecuredResourcesConfig(this, `${stack_id}-config`,{
    conformancePacks: [CdkConstructSecuredResourcesConfig.rdsBestPracticesComformancePack],
    configDeliveryS3Bucket: cdk.aws_s3.Bucket.fromBucketArn(this, `${stack_id}-config-s3`, s3BucketForConfig)  
});

```

## References
* [1]: Network-level security best practices for Amazon RDS
https://aws.amazon.com/blogs/database/security-best-practices-for-amazon-rds-for-mysql-and-mariadb-instances/
* [2]: Amazon RDS Security
https://aws.amazon.com/rds/features/security/#Encryption_of_Data_at_Rest
npm package: @richkang/cdk-construct-lambda-custom-config-rule
Description: Lambda function for AWS Config custom rule
Author: Richard Kang
Latest version: 0.1.7

# AWS Config Custom Lambda Rule: RDS Subnet Internet Route Detector

This AWS Config custom Lambda rule is designed to check whether an Amazon RDS subnet has an internet route in its associated route tables. The rule uses a Lambda function written in Node.js to evaluate the compliance of RDS subnets.

## Lambda Function Structure

The Lambda function responsible for evaluating RDS subnets consists of the following components:

1. **Lambda Function Code (`rds_public_subnet_rule.ts`)**: The Lambda function code is written in TypeScript and utilizes the AWS SDK to invoke services from AWS EC2, Amazon RDS and AWS Config. It parses the AWS Config event to determine the resource type (AWS::RDS::RDSInstance), retrieves the associated subnets and route tables, and checks if any of them have an internet route (0.0.0.0/0). The compliance result is then reported back to AWS Config.

2. **Event Input (`event: AWSConfig.Event`)**: The Lambda function receives input from AWS Config, which includes information about the evaluated resource and the rule parameters, such as the route table IDs to check.

3. **AWS SDK Integration (`AWS from 'aws-sdk'`)**: The function uses the AWS SDK to describe the RDS Instance, subnets, and route tables, subnets. This allows it to check for internet routes.

4. **Compliance Reporting**: Depending on the evaluation result, the Lambda function reports compliance as either 'COMPLIANT' or 'NON_COMPLIANT' to AWS Config. If the rule does not apply to the resource type, it reports 'NOT_APPLICABLE'.

## Infrastructure Components

This AWS Config Custom Lambda Rule leverages AWS CDK (Cloud Development Kit) to define and deploy the necessary infrastructure components. The components include:

1. **AWS CDK Construct (`cdk-construct-lambda-config-custom-rule.ts`)**: A CDK construct that deploys the Lambda function using [NodejsFunction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs.NodejsFunction.html).

## Usage

1. Creates a AWS CDK stack to instantiate the construct. Example of usage can be found in `test/testApp.ts`.

## Prerequisites

- [AWS CDK](https://aws.amazon.com/cdk/) installed and configured.
- Appropriate IAM permissions to deploy AWS CDK stacks and create Lambda functions.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @richkang/cdk-construct-transfer-sftp-s3-kms
Description: A CDK construct to create a Transfer Family SFTP host backed by a KMS encrypted S3 bucket, and a SFTP user
Author: Richard Kang
Latest version: 0.1.2

# AWS Transfer SFTP host backed by KMS encrpyted S3 bucket

A CDK construct to create a Transfer Family SFTP host backed by a KMS encrypted S3 bucket, and a SFTP user

Optionally, `AwsTransferSFTPUserConstruct` can be used separately to create new SFTP user by passing in the existing SFTP server id

```
new AwsTransferSFTPUserConstruct(this, "sftpUser2", {
    sftpServer: <existing SFTP server id>,
    kmsKey: <existing kmsKey that the new SFTP user need to be granted the key access>,
    s3Bucket: <eixsting s3bucket>
})
```

# Example use case

1. Create a folder, `mkdir aws-sftp`
1. Initialize a CDK app `cdk init app --language typescript`
1. Add the dependency to `@richkang/cdk-construct-transfer-sftp-s3-kms` with command `npm i --save @richkang/cdk-construct-transfer-sftp-s3-kms`
1. In the `bin/aws-sftp.ts`, pass in the `region` and `account` as `env`:

```
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { AwsSftpStack } from '../lib/aws-sftp-stack';

const app = new cdk.App();
new AwsSftpStack(app, 'AwsSftpStack', {
  env: {
    region: process.env.CDK_DEFAULT_REGION,
    account: process.env.CDK_DEFAULT_ACCOUNT,
  },

});
```
1. In the `lib/aws-sftp-stack.ts`

```
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as sftp from "@richkang/cdk-construct-transfer-sftp-s3-kms";

export class AwsSftpCdk2Stack extends cdk.Stack {
  constructor(scope: Construct, id: string, props: cdk.StackProps) {
    super(scope, id, props);

    new sftp.AwsTransferSFTPUserConstruct(this, "sftpUser", {
      userName: "richard",
      env: props.env
    })
  }
}
```

1. Once `cdk deploy` successful, update the SFTP user public key with the output from the `cdk deploy`, such as

```
Outputs:
AwsSftpCdk2Stack.sftpUsersftpUserOutputD6611E91 = aws transfer import-ssh-public-key --server-id s-022a52dd12e741258 --user-name <sftp user name> --ssh-public-key-body <ssh public key body>
```
npm package: @richkang/cdk-egress-api-proxy
Description: CDK construct for egress API proxy using a Private AWS API Gateway
Author: Richard Kang
Latest version: 0.1.1


# Egress API Proxy Constructs for AWS CDK

This project contains AWS CDK constructs to set up an API Gateway with a VPC endpoint for secure outbound traffic (egress) management. The main constructs are:

- `EgressApiProxyConstruct`: Sets up a private API Gateway with a proxy integration to an external API endpoint.
- `EgressApiProxyVpcEndpointConstruct`: Creates a VPC endpoint for the API Gateway to securely manage network traffic.

## Getting Started

### Prerequisites

- [AWS CDK](https://aws.amazon.com/cdk/) installed
- Node.js installed
- AWS CLI configured
- Basic knowledge of TypeScript and AWS CDK

### Installation

1. Clone this repository:

    ```bash
    git clone https://github.com/kangks/cdk-egress-api-proxy.git
    cd egress-api-proxy-construct
    ```

2. Install dependencies:

    ```bash
    npm install
    ```

### Configuration

1. Create a `config.json` file in the root of the project with the following structure:

    ```json
    {
      "dev": {
        "stack-prefix": "dev",
        "vpcId": "vpc-123456",
        "subnets": [
          { "avaialbilityZone": "us-east-1a", "subnetId": "subnet-123456" }
        ],
        "cidrAPIcallee": "0.0.0.0/0",
        "rootResource": "api"
      }
    }
    ```

    Adjust the values to match your AWS environment.

### Usage

1. The example provided in `egress-api-proxy.ts` demonstrates how to use `EgressApiProxyConstruct` and `EgressApiProxyVpcEndpointConstruct`:

    ```typescript
    import 'source-map-support/register';
    import * as cdk from 'aws-cdk-lib';
    import * as proxy from './egress-api-proxy-construct';
    import { EgressApiProxyVpcEndpointConstruct } from './lib/EgressApiProxyVpcEndpointConstruct';

    const config = require('./config.json');

    const app = new cdk.App();
    const stageName = app.node.tryGetContext('stageName');
    const prefix = config[stageName]['stack-prefix'];

    // API Stack
    const stack = new cdk.Stack(app, `${prefix}-api-stack`);
    const construct = new proxy.EgressApiProxyConstruct(stack, prefix, {
      vpcId: config[stageName]['vpcId'],
      subnets: config[stageName]['subnets'],
      cidrAPIcallee: config[stageName]['cidrAPIcallee'],
      rootResource: config[stageName]['rootResource'],
    });

    // VPC Endpoint Stack
    const vpcStack = new cdk.Stack(app, `${prefix}-vpce-stack`);
    const vpce = new EgressApiProxyVpcEndpointConstruct(vpcStack, `${prefix}-vpce`, {
      vpcId: config[stageName]['vpcId'],
      subnets: config[stageName]['subnets'],
      CidrAPIcallee: config[stageName]['CidrAPIcallee'],
    });
    vpce.node.addDependency(construct);
    ```

3. Deploy this CDK application to your AWS environment.
    ```bash
    npx cdk deploy --context stageName=dev
    ```


### Clean Up

To delete the created resources, run:

```bash
npx cdk destroy --context stageName=dev
```

## License

This project is licensed under the MIT License.
npm package: @richlewis42/callable
Description: Callable instances for JS
Author: Rich Lewis
Latest version: 0.2.1

# @richlewis42/callable [![npm-version][npm-badge]][npm-link]

Callable instances for JS, in under 10 lines of ES6!

## Motivation

Anything class be a function in _Python_ simply by implementing a `__call__` method.

For example,

```python
class ImaFunc(object):
  def __init__(self, a):
    super()
    self.a = a

  @property
  def b(self):
    return self.a + 10

  def __call__(self, c):
  return [self.a, self.b, c]

f = ImaFunc(10)
f(30)                  # [10, 20, 30]
```

This can be really useful: the callable method has access to the member attributes and properties, so we can change how the function behaves post instatiation:

```python
f.a = 40
f(60)                  # [40, 50, 60]
```

Additionally, the instance works with the class hierarchy nicely:

```python
isinstance(f, ImaFunc) # True
isinstance(f, object)  # True
callable(f)            # True
```

However, in JavaScript, this is not so straightforward... until now!!

### Install

For `node`:

```shell
npm install @richlewis/callable
```

For the browser, you can include a script tag to pull the library from unpkg:

```html
<script
  type="text/javascript"
  src="https://unpkg.com/@richlewis/callable"
></script>
```

### Usage

Inherit from the default export of this library, `Callable`:

```javascript
class ImaFunc extends Callable {
  constructor(a) {
    super()
    this.a = a
  }

  get b() {
    return this.a + 10
  }

  __call__(c) {
    return [this.a, this.b, c]
  }
}

const f = new ImaFunc(10)
f(30) // [10, 20, 30]

f instanceof ImaFunc // true
f instanceof Callable // true
f instanceof Object // true
f instanceof Function // true
```

Now you can do some func-y tricks:

```javascript
class SubFunc extends ImaFunc {
  constructor(a, d) {
    super(a)
    this.d = d
  }

  get e() {
    return this.d + 10
  }

  __call__(c, f) {
    return [...super.__call__(c), this.d, this.e, f]
  }
}

new SubFunc(10, 40)(30, 60) // [10, 20, 30, 40, 50, 60]
```

## How does it work?

Callable hijacks the constructor, returning a `function` that executes the `__call__` function bound to itself.
This function gets the prototype and member properties from the `this` object, and thus the inheritance chain is repaired!

## Prior Art

Other libraries that present similar functionality:

- [callable-instance](https://www.npmjs.com/package/callable-instance)
- [callable-object](https://www.npmjs.com/package/callable-object)
- [callable-class](https://www.npmjs.com/package/callable-class)
- [putil-callable](https://www.npmjs.com/package/putil-callable)

## License

[MIT](https://opensource.org/licenses/mit) @ [Rich Lewis](https://richlew.is/)

[npm-badge]: https://img.shields.io/npm/v/@richlewis42/callable.svg?style=flat-square
[npm-link]: http://www.npmjs.com/package/@richlewis42/callable
npm package: @richlewis42/skeleton-css
Description: npm installer for Skeleton with normalize.css
Author: Patrick Grimard
Latest version: 2.0.4

# [Skeleton](http://getskeleton.com)
Skeleton is a simple, responsive boilerplate to kickstart any responsive project.

Check out <http://getskeleton.com> for documentation and details.

## Getting started

```
npm install --save skeleton-css
```


### What's in the download?

The download includes Skeleton's CSS, Normalize CSS as a reset, a sample favicon, and an index.html as a starting point.

```
Skeleton/
├── index.html
├── css/
│   ├── normalize.min.css
│   └── skeleton.css
└── images/
    └── favicon.ico
```

### Why it's awesome

Skeleton is lightweight and simple. It styles only raw HTML elements (with a few exceptions) and provides a responsive grid. Nothing more.
- Around 400 lines of CSS unminified and with comments
- It's a starting point, not a UI framework
- No compiling or installing...just vanilla CSS


## Browser support

- Chrome latest
- Firefox latest
- Opera latest
- Safari latest
- IE latest

The above list is non-exhaustive. Skeleton works perfectly with almost all older versions of the browsers above, though IE certainly has large degradation prior to IE9.


## License

All parts of Skeleton are free to use and abuse under the [open-source MIT license](https://github.com/dhg/Skeleton/blob/master/LICENSE.md).


## Extensions

The following are extensions to Skeleton built by the community. They are not officially supported, but all have been tested and are compatible with v2.0 (exact release noted):
- [Skeleton on LESS](https://github.com/whatsnewsaes/Skeleton-less): Skeleton built with LESS for easier replacement of grid, color, and media queries. (Last update was to match v2.0.1)
- [Skeleton on Sass](https://github.com/whatsnewsaes/Skeleton-Sass): Skeleton built with Sass for easier replacement of grid, color, and media queries. (Last update was to match v2.0.1)

Have an extension you want to see here? Just shoot an email to hi@getskeleton.com with your extension!


## Colophon

Skeleton was built using [Sublime Text 3](http://www.sublimetext.com/3) and designed with [Sketch](http://bohemiancoding.com/sketch). The typeface [Raleway](http://www.google.com/fonts/specimen/Raleway) was created by [Matt McInerney](http://matt.cc/) and [Pablo Impallari](http://www.impallari.com/). Code highlighting by Google's [Prettify library](https://code.google.com/p/google-code-prettify/). Icons in the header of the documentation are all derivative work of icons from [The Noun Project](http://thenounproject.com). [Feather](http://thenounproject.com/term/feather/22073) by Zach VanDeHey, [Pen](http://thenounproject.com/term/pen/21163) (with cap) by Ed Harrison, [Pen](http://thenounproject.com/term/pen/32847) (with clicker) by Matthew Hall, and [Watch](http://thenounproject.com/term/watch/48015) by Julien Deveaux.


## Acknowledgement

Skeleton was created by [Dave Gamache](https://twitter.com/dhg) for a better web.
npm package: @richmd/core
Description: It is a core package of Richmd.
Author: nappa
Latest version: 5.0.3

# Richmd

![NPM License](https://img.shields.io/npm/l/%40richmd%2Fcore)
![NPM Version](https://img.shields.io/npm/v/%40richmd%2Fcore)
![NPM Downloads](https://img.shields.io/npm/dw/%40richmd%2Fcore)

## What is Richmd?
Richmd is a tool for making Rich contents Markdown language.

![Richmd](./docs/images/preview.png)

## Usage
In general, installing `@richmd/core` is not necessary. For actual usage, we recommend using one of the following packages instead.

### JavaScript (TypeScript)
For more details, please see the README of [@richmd/js](https://github.com/richmd/js).

```sh
pnpm add @richmd/js
```

### React
For more details, please see the README of [@richmd/react](https://github.com/richmd/react).

```sh
pnpm add @richmd/react
```

### Vue
For more details, please see the README of [@richmd/vue](https://github.com/richmd/vue).

```sh
pnpm add @richmd/vue
```

## Methods
### `parseTree()`

You can retrieve Abstract Syntax Tree (AST) data using the `parseTree` method.
This is useful for customizing code generation on your own.

To use the parser standalone, you need to install `@richmd/core`.

```sh
$ pnpm add @richmd/core
```

#### Sample

```js
import { parseTree } from '@richmd/core';

const text = `# aaaa
## aaaaa

**aaaaaa**
`

const ast = parseTree(text);
```

## Markdown Syntax
Please read [Richmd Markdown Syntax Documentation](./docs/md-syntax.md).

### Supported Syntax
- strong
- italic
- image
- link
- headings
- horizontal rule
- blockquote
- unordeed list
- ordered list
- strikethrough
- code block
- checkbox list
- table
- TeX syntax (using [KaTeX](https://katex.org/))
- Color Inline Block
- Dropdown details
- Video(HTML5 Video Tag)
- Custom HTML Tag
- [Slide Mode (v4 ~)](./docs/slide-mode.md)

## License
MIT

## Thank you :pray:
- [Markdown-tree-parser](https://github.com/ysugimoto/markdown-tree-parser)
  - Richmd's Markdown parser was created using the code in markdown-tree-parser as a reference.
- [KaTeX](https://github.com/KaTeX/KaTeX)
- [highlight.js](https://github.com/highlightjs/highlight.js/)
npm package: @richmd/js
Description: It is Converting Html package of Richmd.
Author: nappa
Latest version: 3.0.3

# @richmd/js

![NPM License](https://img.shields.io/npm/l/%40richmd%2Fjs)
![NPM Version](https://img.shields.io/npm/v/%40richmd%2Fjs)
![NPM Downloads](https://img.shields.io/npm/dw/%40richmd%2Fjs)

A JavaScript library for converting Markdown to HTML with rich features. This package is part of the Richmd ecosystem, providing a simple way to render Markdown content as HTML in JavaScript applications.

## Features

- Converts Markdown to HTML
- Supports standard Markdown syntax
- Enhanced features:
  - Syntax highlighting for code blocks
  - Math expressions with KaTeX
  - Tables
  - Task lists
  - Blockquotes
  - Details/summary blocks
  - Color blocks
  - Custom tags
- Includes CSS styling for rendered content

## Installation

You can install @richmd/js using npm, yarn, or pnpm:

```bash
# Using npm
npm install @richmd/js

# Using yarn
yarn add @richmd/js

# Using pnpm
pnpm add @richmd/js
```

## Usage

### Basic Usage

```javascript
import { richmd } from '@richmd/js';
import '@richmd/js/dist/richmd.css'; // Import the styles

// Convert Markdown to HTML
const markdown = '# Hello World\n\nThis is a **bold** text.';
const { html } = richmd(markdown);

// Use the HTML in your application
document.getElementById('content').innerHTML = html;
```

## Supported Markdown Syntax

@richmd/js supports standard Markdown syntax as well as extended features:

### Basic Markdown

- Headings (`# Heading`)
- Emphasis (`*italic*`, `**bold**`)
- Lists (ordered and unordered)
- Links (`[text](url)`)
- Images (`![alt](src)`)
- Code blocks (``` code ```)
- Blockquotes (`> quote`)
- Horizontal rules (`---`)

### Extended Features

- Task lists (`- [ ] task` or `- [x] completed task`)
- Tables
- Math expressions using KaTeX
- Color blocks
- Details/summary blocks
- Custom tags

## Dependencies

@richmd/js depends on:

- @richmd/core - Core parsing functionality
- highlight.js - For code syntax highlighting
- katex - For rendering mathematical expressions

## License

MIT
npm package: @richmonkeys/aes-256-gcm
Description: Node.js aes-256-gcm encryption and decryption implementations with some quality-of-life options.
Author: richmonkeys
Latest version: 1.1.3

# aes-256-gcm
Node.js aes-256-gcm encryption and decryption implementations with some quality-of-life options.

Installation
-
```bash
npm install node-aes-gcm
```

Usage
-
```typescript
import { encrypt, decrypt } from '@richmonkeys/aes-256-gcm'

const encrypted = encrypt('super secret', 'my-secret-password-key')
```
npm package: @richord/lark-cli
Description: Distribute feishu-cli via npm
Latest version: 0.0.4

# @richord/lark-cli

`@richord/lark-cli` 是 `feishu-cli` 的 npm 分发包。

安装后可直接使用：

```bash
npm install -g @richord/lark-cli
larkcli --help
```

兼容旧命令名：

```bash
feishu-cli --help
```

安装阶段会按当前平台自动下载对应的 GitHub Release 二进制文件。

如果你只想跳过下载逻辑，可设置：

```bash
LARKCLI_SKIP_DOWNLOAD=1 npm install -g @richord/lark-cli
```
npm package: @richov/js-async-queue
Description: A simple asynchronous queue based on js promises.
Author: Ricardo Moran
Latest version: 1.0.0

# js-async-queue

This is a simple asynchronous queue with an unbounded buffer (puts never block, takes can block if the buffer is empty).

The implementation is quite simple, mostly because of the single-threaded nature of javascript which allowed me to make some assumptions on the execution of the code.
npm package: @richseviora/gatsby-plugin-drive
Description: Downloads and caches a Google Drive folder that you can then query with gatsby-source-filesystem.
Author: Rich Seviora
Latest version: 0.4.1

# gatsby-plugin-drive

Downloads and caches a Google Drive folder that you can then query with `gatsby-source-filesystem`.
Optionally exports Google Docs to a usable format.

## Installation

```bash
yarn add @fs/gatsby-plugin-drive
```

## Usage

In order to use this plugin, you'll need to generate a Google Service Account and share your drive folder with its email. [Here's a guide](https://www.twilio.com/blog/2017/03/google-spreadsheets-and-javascriptnode-js.html).

```js
// In your gatsby-config.js

plugins: [
  {
    resolve: '@fs/gatsby-plugin-drive',
    options: {
      folderId: 'GOOGLE_DRIVE_FOLDER_ID',
      keyFile: path.resolve(__dirname, 'YOUR_SERVICE_ACCOUNT_KEYFILE.json'),
      destination: path.join(__dirname, 'src/content'),
      exportGDocs: true,
      exportMimeType: 'text/html',
      exportMiddleware: someFunction
    }
  }
]

// Or using environment variables

plugins: [
  {
    resolve: '@fs/gatsby-plugin-drive',
    options: {
      folderId: process.env.GOOGLE_DRIVE_FOLDER_ID,
      key: {
        private_key: process.env.GOOGLE_PRIVATE_KEY,
        client_email: process.env.GOOGLE_CLIENT_EMAIL,
      },
      destination: path.join(__dirname, 'src/content'),
      exportGDocs: true,
      exportMimeType: 'text/html',
      exportMiddleware: someFunction
    }
  }
]
```
If the `exportGDocs` option is enabled, all Google Docs in the folder will be exported with the MIME type set in the `exportMimeType` option. You can see a list of available Google Docs export MIME types [here](https://developers.google.com/drive/api/v3/manage-downloads).
If the `exportGDocs` option is disabled, all Google Docs in the folder will be ignored.

The `exportMiddleware` option is optional. If set, the plugin will run each Google Doc through the function, before it writes it to disk.
A usecase for this, could be cleaning up, or manipulating, the HTML that the Google Drive API returns.  
The expected function signature is `Buffer -> Buffer`.

Your drive folder will download all files everytime it builds, except when a file already exists or is cached. To download all files again, set up an npm clean script like:

```json
"clean": "rimraf src/content",
```

## Rate Limiting

The default amount of allowed requests per user per 100 seconds is `1,000`. If you're planning to download a large folder with this plugin, you might have to increase this limit. To do that, open the "Services" tab in the Google Cloud Console, select "Google Drive API" and change the limit under ["Quotas"](https://console.developers.google.com/apis/api/drive.googleapis.com/quotas).

## Author

* Fabian Schultz ([@fschultz\_](https://twitter.com/fschultz_)) - [Stink Studios](https://stinkstudios.com)
* Elias Jørgensen ([@\_eliasjorgensen](https://twitter.com/_eliasjorgensen))
npm package: @richseviora/gatsby-source-drive
Description: Downloads a Google Drive folder and adds graphql nodes for the files.
Author: Rich Seviora
Latest version: 0.0.2

# gatsby-source-drive

Downloads a Google Drive folder and adds graphql nodes for the files.

> This is still a work in progress.

## Installation

```bash
yarn add gatsby-source-drive
```

## How to Use

In order to use this plugin, you'll need to generate a Google Service Account and share your drive folder with its email. [Here's a guide](https://www.twilio.com/blog/2017/03/google-spreadsheets-and-javascriptnode-js.html). The below configuration references values in the JSON keyfile.

```js
// In your gatsby-config.js

plugins: [
  {
    resolve: `gatsby-source-drive`,
    options: {
      folderId: `GOOGLE_DRIVE_FOLDER_ID`,
      key: `value of "private_key" in key file`,
      serviceAccountEmail: `value of "client_email" in key file`
    },
  },
],
```

The `key` is very long (and also not something you'll want in a VCS-checked-in file), so I recommend using a solution like [dotenv](https://www.npmjs.com/package/dotenv) to store the values in an `.env` file, and then referencing them like so:

```js
plugins: [
  {
    resolve: `gatsby-source-drive`,
    options: {
      folderId: process.env.GOOGLE_DRIVE_FOLDER_ID,
      key: process.env.GOOGLE_KEY,
      serviceAccountEmail: process.env.GOOGLE_SA_EMAIL
    },
  },
],
```

And then if you deploy to [Netlify](https://www.netlify.com) (or similar), you can use their environment variables UI to store the values.

## How to Query

```graphql
  query {
    allDriveNode {
      edges {
        node {
          id
          fields { slug }
          localFile {
            # e.g., for an image
            childImageSharp {
              fixed(width: 150, height: 150) {
                ...GatsbyImageSharpFixed
              }
            }
          }
        }
      }
    }
  }
```


## Author

* Joe Palmieri https://jpalmieri.com [Lumos Labs](https://www.lumosity.com)
npm package: @richthegeek/htmldecode
Description: Decode HTML characters in a small package
Author: Richard Lyon
Latest version: 1.0.1

# HTMLDecode

Decode HTML entity characters in a string into their proper character forms. Focus is on package size (~10kb gzipped) rather than speed, although it's certainly not slow.

Supported formats:
 * `&AElig;`
 * `&aelig;`
 * `&#198;`
 * `&#x000C6;`

It does not support non-strict codes (e.g. `&amp` without `;`) because this causes more problems than it solves.
npm package: @richview/editorjs-table
Description: Table for Editor.js, forked from 2.2.1
Author: CodeX Team
Latest version: 2.2.1

# Table tool

The Table Block for the [Editor.js](https://editorjs.io). Finally improved.

![](assets/68747470733a2f2f636170656c6c612e706963732f34313239346365632d613262332d343135372d383339392d6666656665643364386666642e6a7067.jpeg)

## Installation

Get the package

```shell
npm i --save @editorjs/table
```
or

```shell
yarn add @editorjs/table
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
import Table from '@editorjs/table';

var editor = EditorJS({
  tools: {
    table: Table,
  }
});
```

Or init the Table tool with additional settings

```javascript
var editor = EditorJS({
  tools: {
    table: {
      class: Table,
      inlineToolbar: true,
      config: {
        rows: 2,
        cols: 3,
      },
    },
  },
});
```

## Config Params

| Field              | Type     | Description          |
| ------------------ | -------- | ---------------------------------------- |
| `rows`             | `number` | initial number of rows. `2`  by default |
| `cols`             | `number` | initial number of columns. `2` by default |
| `withHeadings`             | `boolean` | toggle table headings. `false` by default |

## Output data

This Tool returns `data` in the following format

| Field          | Type         | Description           |
| -------------- | ------------ | ----------------------------------------- |
| `withHeadings` | `boolean`    | Uses the first line as headings |
| `content`      | `string[][]` | two-dimensional array with table contents |

```json
{
  "type" : "table",
  "data" : {
    "withHeadings": true,
    "content" : [ [ "Kine", "Pigs", "Chicken" ], [ "1 pcs", "3 pcs", "12 pcs" ], [ "100$", "200$", "150$" ] ]
  }
}
```

# Support maintenance 🎖

If you're using this tool and editor.js in your business, please consider supporting their maintenance and evolution.

[http://opencollective.com/editorjs](http://opencollective.com/editorjs)

# About CodeX

<img align="right" width="120" height="120" src="https://codex.so/public/app/img/codex-logo.svg" hspace="50">

CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are [open](https://codex.so/join) for young people who want to constantly improve their skills and grow professionally with experiments in leading technologies.

| 🌐 | Join  👋  | Twitter | Instagram |
| -- | -- | -- | -- |
| [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team) |