open-index/open-npm huggingface dataset:
npm package: @richardo2016/fake-sample
Description: A fake sample package for testing monorepo publishing
Latest version: 1.0.0

# @richardo2016/fake-sample

A fake sample package for testing the monorepo publishing workflow.

## Installation

```bash
npm install @richardo2016/fake-sample
# or
yarn add @richardo2016/fake-sample
```

## Usage

```typescript
import { FakeSample, createSample } from '@richardo2016/fake-sample';

// Using the class
const sample = new FakeSample({ name: 'MyApp', version: '1.0.0' });
console.log(sample.greet()); // "Hello from MyApp v1.0.0!"

// Using the factory function
const sample2 = createSample('MyApp', '2.0.0');
console.log(sample2.getInfo());
```

## API

### `FakeSample`

Main class for the sample package.

#### Constructor

```typescript
new FakeSample(options: SampleOptions)
```

- `options.name` (string): The name of the sample
- `options.version` (string, optional): Version string

#### Methods

- `greet(): string` - Returns a greeting message
- `getInfo(): object` - Returns package info with timestamp

### `createSample(name, version?)`

Factory function to create a FakeSample instance.

### `isMonorepo()`

Returns `true` (this is a monorepo package!).

## License

MIT
npm package: @richardo2016/libjs
Description: [![Build Status](https://travis-ci.org/richardo2016/libjs.svg)](https://travis-ci.org/richardo2016/libjs) [![NPM version](https://img.shields.io/npm/v/@richardo2016/libjs.svg)](https://www.npmjs.org/package/@richardo2016/libjs)
Author: Chen Lei
Latest version: 0.0.2

# @richardo2016/libjs

[![Build Status](https://travis-ci.org/richardo2016/libjs.svg)](https://travis-ci.org/richardo2016/libjs)
[![NPM version](https://img.shields.io/npm/v/@richardo2016/libjs.svg)](https://www.npmjs.org/package/@richardo2016/libjs)


[richard]'s lib of javascript.

## What is this repo?

I learn javascript from 2014, then I write frontend/backend code in nodejs. In my work, I need some general pure javascript patterns/functions not about PALTFORM(such as nodejs/[fibjs]).

So I collect them and publish it in npm.

## Usage

```bash
npm i -S @richardo2016/libjs
```

## APIs

- [modules]
    - [module:built-in]
    - [module:primitive]
    - [module:constant]
    - [module:struct]

## License

[MIT](https://opensource.org/licenses/MIT)

Copyright (c) 2016-present, Richard

[richard]://js.chenlei.me
[fibjs]://fibjs.org

[modules]:./src/index.ts
[module:built-in]:./src/built-in/README.md
[module:primitive]:./src/primitive/README.md
[module:constant]:./src/constant/README.md
[module:struct]:./src/struct/README.md
npm package: @richardpickett/api-lib
Description: A library of notion wrapper classes
Author: Richard@RichardPickett.com
Latest version: 1.1.24

# api lib

# Add to your packages.json:

`npm i @richardpickett/api-lib`

# Usage

## Extend to make your own api class:

```javascript
import { Api } from "@richardpickett/api-lib";

class MyApi extends Api {
  constructor() {
    super({ baseUrl: "https://myApi.com/vi" });
  }

  async mySpecificApiCall(body) {
    return this._fetch({ path: "/my/api/call/path", body });
  }
}

const myApi = new MyAPI();

export default myApi;
```

## Quck start: use your API class

```javascript
import myApi from "./myApi.js";

myApi.mySpecificApiCall({ var: "val" }).then((jsonResult) => {
  console.log(JSON.stringify(jsonResult, null, 2));
});
```

### The constructor

`constructor({ baseUrl = "", headers = { "Content-Type": "application/json" } })`

Override `baseUrl` with your api's base Url, and override the `headers` as needed. The headers set here are used in all subsequent calls unless the header is deleted with `deleteHeader(name)`.

### Calling your Api

`_fetch({ path = "/", body = false, method = "POST", headers = this.headers, redirect = "follow" })`

Typically you will override the `path` and `body`, overriding the `method`, `headers`, and `redirect` as needed.

`path`: appended to the `baseUrl`
`body`: JSON encoded data for `POST` (build your own URI parameters and append to `path` if using `GET` with variables)
`method`: all common HTTP methods are supported
`redirect`: passed through to node's `fetch()`

## Using specific headers

The headers for every call can be set in the `super()` constructor call, like this:

```javascript
import Api from "@richardpickett/api-lib";

class MyApi extends Api {
    constructor() {
        super( { baseUrl: "https://myApi.com/vi", headers: { "HeaderName": "HeaderValue" } } )
    }
...
```

You can set specific headers (Auth tokens, etc) via the constructor, or for specific calls when you call `_fetch()`. Please note, if you supply headers to the `_fetch()` call, it will not use the headers set in the constructor or via `setHeader()`

The default header set in the constructor is: `{ "Content-Type": "application/json" }`

### Setting headers for every call after constructor

Use the following to set/unset the default headers for every call:

```javascript
setHeader(name, value);
deleteHeader(name);
```

### Using a cookie jar

If your api sets cookies and you need to use them on subsequent calls, use `_cookieFetch()` instead of `_fetch()`, all the same parameters apply, with the addition that each call will use a cookie jar for each call.
npm package: @richardpickett/config-js
Description: A config class for nodejs
Author: Richard@RichardPickett.com
Latest version: 1.0.26

# Config JS

```bash
npm i @richardpickett/config-js
```

```javascript
// config.js
import Config from "@richardpickett/config-js";
import packageJson from "../package.json" assert { type: "json" };

const skipDotEnv = true; // skip reading .env files

const config = new Config({
  jsonVariables: ["SOME_JSON_ENV_VAR", "ANOTHER_JSON_ENV_VAR"],
  packageJson,
  skipDotEnv,
  envJson: ["THIRD_JSON"],
});
export default config;
```

The above will (a) not read .env files, (b) take environment variables `SOME_JSON_ENV_VAR` and `ANOTHER_JSON_ENV_VAR`, JSON.parse() them and assign them as variables you can reach using `config.SOME_JSON_ENV_VAR` and `ANOTHER_JSON_ENV_VAR`, and (c) JSON.parse() `THIRD_JSON` in the same way, but also take each element of `THIRD_JSON` and assign them to `process.env[element]`.

You can also store the config in your environment, requiring no code change when you add additional JSON variables, add expanded variables to `process.env`, or even use `dotenv` for local loading of the environment while turning it off in production (where you would supply the environment by IoC and not `.env` files in the container)

Here's the environment variable version of the above config options:

```bash
CONFIG_JS='{"jsonVariables":["SOME_JSON_ENV_VAR","ANOTHER_JSON_ENV_VAR"],"packageJson":{"name":"@richardpickett/config-js","version":"0.2.2"},"skipDotEnv":true,"envJson":["THIRD_JSON"]}'
```
npm package: @richardpickett/my-momentjs
Description: A config class for nodejs
Author: Richard@RichardPickett.com
Latest version: 1.0.28

# My momentjs

```bash
npm i @richardpickett/my-momentjs
```

```javascript
var m = newMyMoment();

// 2023-07-17 12:12:15
console.log(m.FT());

// 2023-07-17T17:12:15.749Z
console.log(m.ISO());

// 2023-07-17T12:12:15-05:00
console.log(m.momentISOLocalTimeZone());

// Mon Jul 17 2023 12:12:15 GMT-0500
console.log(m.toString());

// same as toString
// Mon Jul 17 2023 12:12:15 GMT-0500
console.log(`${m}`);

var d = new Date();
// Mon Jul 17 2023 12:12:15 GMT-0500 (Central Daylight Time)
console.log(`${d}`);
```

## momentjs Extensions

All the same functions of momentjs are available, here are some common ones:

```javascript
newMyMoment().subtract(10, "days").calendar(); // 07/27/2023
newMyMoment().subtract(6, "days").calendar(); // Last Monday at 12:57 PM
newMyMoment().subtract(3, "days").calendar(); // Last Thursday at 12:57 PM
newMyMoment().subtract(1, "days").calendar(); // Yesterday at 12:57 PM
newMyMoment().calendar(); // Today at 12:57 PM
newMyMoment().add(1, "days").calendar(); // Tomorrow at 12:57 PM
newMyMoment().add(3, "days").calendar(); // Wednesday at 12:57 PM
newMyMoment().add(10, "days").calendar(); // 08/16/2023
newMyMoment().subtract(1, "day").isBefore(moment()); // true
```
npm package: @richardpickett/notion-lib
Description: A library of notion wrapper classes
Author: Richard@RichardPickett.com
Latest version: 2.0.56

# Notion Library

## Schema file example

```json
const schemas = {
  databaseName: {
    id: "Get this from the database url",
    integrationToken: "this can either be the token of your integration (insecure), or the environment variable name the token is stored as",
  },
};
export default schemas;
export { schemas };

```

## Search examples

```javascript
database.search(["Number", "is_not_empty", true], (row) => {
  // use row
});
```

Filter reference:
<https://developers.notion.com/reference/post-database-query-filter>
npm package: @richardscull/eslint-config
Description: ESLint Config
Author: richardscull, original by hyoban
Latest version: 1.0.12

# richardscull's eslint-config

richardscull's ESLint Fork (original by hyoban) Config enables most of the recommended rules for `js`, `ts`, and `react`, uses ESLint for formatting, and provides a lot of useful plugins.

> [!TIP]
> You may not need `lint-staged` and `simple-git-hooks` if you don't ignore auto-fix for rules in the editor.

```sh
ni i -D eslint @richardscull/eslint-config lint-staged simple-git-hooks
```

If you are using ESLint 9.9.0 and `eslint.config.ts`, you need to install `jiti`.

```sh
ni -D jiti
```

> [!TIP]
> You can install the nightly version from [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new), for example, `ni -D https://pkg.pr.new/hyoban/eslint-config-hyoban@{commit}`.

`eslint.config.mjs` or `eslint.config.ts` if you are using ESLint 9.9.0.

```ts
// @ts-check
import { defineConfig } from '@richardscull/eslint-config'

export default defineConfig()
```

> [!TIP]
> You can customize the preset by passing options according to [available options](https://github.com/hyoban/eslint-config-hyoban/blob/main/src/option.ts)

`package.json`

```json
{
  "scripts": {
    "lint": "eslint",
    "lint:fix": "eslint --fix",
    "prepare": "simple-git-hooks"
  },
  "simple-git-hooks": {
    "pre-commit": "npx lint-staged"
  },
  "lint-staged": {
    "*": "eslint --fix"
  }
}
```

```jsonc
{
  "eslint.rules.customizations": [
    { "rule": "unused-imports/no-unused-imports", "severity": "warn" },
    { "rule": "test/no-only-tests", "severity": "warn" },
    { "rule": "prefer-const", "severity": "warn" }
  ],

  "eslint.codeActionsOnSave.rules": [
    "!unused-imports/no-unused-imports",
    "!test/no-only-tests",
    "!prefer-const",
    "*"
  ]
}
```
npm package: @richardsimonb/flash-card
Description: Simple flash card component
Author: Richard Simon Bernhard
Latest version: 1.0.3

# Flash Card Component

Flash card component. This component requires React.

## Installation
`npm install @richardsimonb/flash-card`

## Usage
```
import { FlashCard } from '@richardsimonb/flash-card'

function App() {

  const data = [
    {
      question: 'What is the capital of Ethiopia?',
      answer: 'Addis Ababa',
    },
    {
      question: 'What is the ASEAN short of?',
      answer: 'Association of South East Asian Nations',
    },
    {
      question: 'What is the currency of Indonesia?',
      answer: 'Rupiah',
    },
  ]

  return (
    <FlashCard title={'Flash Cards'} data={data}/>
  )
}
```

## License

MIT License