open-index/open-npm huggingface dataset:
npm package: @matters/matters-editor
Description: Editor for matters.news
Author: https://github.com/thematters
Latest version: 0.3.1

# Matters Editor

## Installation

```bash
npm i @matters/matters-editor
```

## Development

```bash
# dev
npm run dev

# build
npm run build

# test
npm run test
```

## Editor

The editor core, built with [TipTap](https://tiptap.dev) & [ProseMirror](https://prosemirror.net/), using by [thematters/matters-web](https://github.com/thematters/matters-web).

```tsx
import {
  EditorContent,
  articleEditorExtensions,
  useEditor,
} from '@matters/matters-editor'

const Editor = () => {
  const editor = useEditor({
    editable: true,
    placeholder: 'Write your article here...',
    content: '', // initial content
    extensions: articleEditorExtensions,
    onUpdate: async ({ editor, transaction }) => {
      const content = editor.getHTML()
      // update({ content })
    },
    // mentionSuggestion, // if you want to enable mention extension
    // extensions: [...], // provides your custom extensions
  })

  return <EditorContent editor={editor} />
}
```

## Transformers

Transformers (using by [thematters/matters-server](https://github.com/thematters/matters-server)) export below functions:

- `md2html`: Convert Markdown to HTML
- `html2md`: Convert HTML to Markdown
- `sanitizeHTML`: Sanitize HTML
- `normalizeArticleHTML`: Normalize article HTML
- `normalizeCommentHTML`: Normalize comment HTML

```ts
import {
  md2html,
  html2md,
  sanitizeHTML,
  normalizeArticleHTML,
  normalizeCommentHTML,
} from '@matters/matters-editor'

const html = md2html('**hello, world**')
const markdown = html2md(html)

const sanitizedHTML = sanitizeHTML('<script>alert("hello, world")</script>')
const articleHTML = normalizeArticleHTML('<p>hello, world</p>')
const comemntHTML = normalizeCommentHTML('<p>hello, world</p>')
```

### Formats

Below formats are supported to convert between Markdown and HTML:

- Headings (`<h1>` to `<h6>`) <-> `#` to `######`;
- Bold (`<bold>`) <-> `**`;
- Italic (`<em>`) <-> `_`;
- Strikethrough (`
`) <-> `~~`;
- Underline (`<u>`) -> `**`;
- Code (`<code>`) <-> `` `code` ``;
- Code Block (`<pre>`) <-> ` ``` `;
- Blockquote (`<blockquote>`) <-> `>`;
- Line Breaks (`<br>`) <-> `\`;
- Horizontal Line (`<hr>`) <-> `---`;
- Ordered List (`<li>`) <-> `1. ABC \n 2. ABC \n 3. ABC`;
- Unordered List (`<ul>`) <-> `* ABC \n * ABC \n * ABC`;
- Link (`<a>`) <-> `[example.com](https://example.com)`;
- Image (`<img>`) <-> `![alt text](https://example.com/a.jpg "title")`;
- Figure (`<figure>`) <-> Raw `<figure>`;

### Examples

Try HTML <=> Markdowns converters in CLI:

1. Put original HTML file into `./examples/original`
2. Run `npm run build:examples`
3. Markdown and HTML (from Markdown) are outputted to `./examples/markdown` and `.examples/html`

Build demo:

```bash
npm run demo:transformers
```

Or try live demo: https://thematters.github.io/matters-editor/transfomers

### Benchmark

```bash
npm run benchmark
```

Results are outputted to `./benchmark/results`
npm package: @matters/passphrases
Description: ## Introduction
Author: https://github.com/thematters
Latest version: 0.0.1-alpha.9

# Passphrases

## Introduction

TODO

## Usage

```bash
npm i @matters/passphrases
```

```js
import { generate, verify } from '@matters/passphrases'

// load default dict or use your custom dict
import { loadDict, loadIndexDict } from '@matters/passphrases/dict'
const dict = loadDict()
const indexDict = loadIndexDict()

// generate and take the first 6 words as passphrases
const passphrases = generate({
  sigPayload: { email: 'test@example' },
  sigExp: 1693036368286,
  sigSecret: 'abc',
  sigDict: dict,
  expDict: dict,
})

// verify passphrases
const isValid = verify({
  passphrases,
  sigPayload: { email: 'test@example' },
  sigSecret: 'abc',
  sigDict: dict,
  expDict: dict,
  expIndexDict: indexDict,
})
```

## Development

```bash
# build
npm run build

# test
npm run test

# build your own dictionary
npm run build:dict

# shuffle the dictionary to make it more secure
npm run shuffle:dict
```

## Benchmark

```bash
npm run benchmark
```
npm package: @matters/passport-likecoin
Description: LikeCoin (like.co) authentication strategy for Passport and Node.js.
Latest version: 1.0.0

# passport-likecoin

[Passport](http://passportjs.org/) strategy for authenticating with [LikeCoin](http://like.co/) using the OAuth 2.0 API.

---

## Install

```bash
$ npm install @matters/passport-likecoin
```

## Usage

#### Configure Strategy

The LikeCoin authentication strategy authenticates users using a LikeCoin
account and OAuth 2.0 tokens.  The app ID and secret obtained when creating an
application are supplied as options when creating the strategy.  The strategy
also requires a `verify` callback, which receives the access token and optional
refresh token, as well as `profile` which contains the authenticated user's
LikeCoin profile.  The `verify` callback must call `cb` providing a user to
complete authentication.

```js
passport.use(new LikeCoinStrategy({
    clientID: LIKECOIN_CLIENT_ID,
    clientSecret: LIKECOIN_CLIENT_SECRET,
    callbackURL: "http://localhost:3000/auth/likecoin/callback"
  },
  function(accessToken, refreshToken, params, profile, cb) {c
    const likerId = params.user;

    User.findOrCreate({ likerId }, function (err, user) {
      return cb(err, user);
    });
  }
));
```

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'likecoin'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

```js
app.get('/auth/likecoin',
  passport.authenticate('likecoin'));

app.get('/auth/likecoin/callback',
  passport.authenticate('likecoin', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });
```

## License

[The MIT License](./LICENSE)
npm package: @matters/slugify
Description: Slugify a string
Author: Sindre Sorhus
Latest version: 0.7.3

# slugify [![Build Status](https://travis-ci.org/sindresorhus/slugify.svg?branch=master)](https://travis-ci.org/sindresorhus/slugify)

> Slugify a string

Useful for URLs, filenames, and IDs.

It correctly handles [German umlauts](https://en.wikipedia.org/wiki/Germanic_umlaut), Vietnamese, Arabic, Russian, Romanian, Turkish and more.


## Install

```
$ npm install @sindresorhus/slugify
```


## Usage

```js
const slugify = require('@sindresorhus/slugify');

slugify('I ♥ Dogs');
//=> 'i-love-dogs'

slugify('  Déjà Vu!  ');
//=> 'deja-vu'

slugify('fooBar 123 $#%');
//=> 'foo-bar-123'

slugify('I ♥ 🦄 & 🐶', {
	customReplacements: [
		['🐶', 'dog']
	]
});
//=> 'i-love-unicorn-and-dog'
```

## API

### slugify(input, [options])

#### input

Type: `string`

#### options

Type: `Object`

##### separator

Type: `string`<br>
Default: `-`

```js
slugify('BAR and baz');
//=> 'bar-and-baz'

slugify('BAR and baz', {separator: '_'});
//=> 'bar_and_baz'
```

##### lowercase

Type: `boolean`<br>
Default: `true`

Make the slug lowercase.

```js
slugify('Déjà Vu!');
//=> 'deja-vu'

slugify('Déjà Vu!', {lowercase: false});
//=> 'Deja-Vu'
```

##### decamelize

Type: `boolean`<br>
Default: `true`

Convert camelcase to separate words. Internally it does `fooBar` → `foo bar`.

```js
slugify('fooBar');
//=> 'foo-bar'

slugify('fooBar', {decamelize: false});
//=> 'foobar'
```

##### customReplacements

Type: `Array<string[]>`<br>
Default: `[
	['&', ' and '],
	['🦄', ' unicorn '],
	['♥', ' love ']
]`

Specifying this only replaces the default if you set an item with the same key, like `&`. The replacements are run on the original string before any other transformations.

```js
slugify('Foo@unicorn', {
	customReplacements: [
		['@', 'at']
	]
});
//=> 'fooatunicorn'
```

Add a leading and trailing space to the replacement to have it separated by dashes:

```js
slugify('foo@unicorn', {
	customReplacements: [
		['@', ' at ']
	]
});
//=> 'foo-at-unicorn'
```


## Related

- [slugify-cli](https://github.com/sindresorhus/slugify-cli) - CLI for this module
- [filenamify](https://github.com/sindresorhus/filenamify) - Convert a string to a valid safe filename


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
npm package: @mattersight/karma-pact-reporter
Description: Karma Pact Publishing Reporter
Author: Nicholas Brink
Latest version: 1.0.4

# Karma Pact Reporter
[Pact Node](https://github.com/pact-foundation/pact-node) wrapper for a Karma Reporter to allow for uploading of Pact files to the Broker when complete.

[![Travis](https://img.shields.io/travis/nbrink91/karma-pact-reporter.svg?style=flat-square&logo=travis)](https://travis-ci.org/pact-foundation/pact-php)
[![npm](https://img.shields.io/npm/v/@mattersight/karma-pact-reporter.svg?style=flat-square)](https://www.npmjs.com/package/@mattersight/karma-pact-reporter)
[![npm](https://img.shields.io/npm/l/@mattersight/karma-pact-reporter.svg?style=flat-square)](https://www.npmjs.com/package/@mattersight/karma-pact-reporter)
[![npm](https://img.shields.io/npm/dt/@mattersight/karma-pact-reporter.svg?style=flat-square)](https://www.npmjs.com/package/@mattersight/karma-pact-reporter)
[![npm](https://img.shields.io/npm/dw/@mattersight/karma-pact-reporter.svg?style=flat-square)](https://www.npmjs.com/package/@mattersight/karma-pact-reporter)

## Install with NPM

```bash
npm i @mattersight/karma-pact-reporter --save-dev
```

## Set up Karma Configuration

Add 'pact' to the list of reporters.

```js
[
    {
        reporters: ['pact']
    }
]
```

Add a pactReporters section and configure according to the [Pact Node Broker Publishing](https://github.com/pact-foundation/pact-node#pact-broker-publishing) section.

This library does include one extra option.

Option | Type | Purpose | Default
---|---|---|---
deletePactFilesOrDirs | bool | Deletes all files in the pactFilesOrDirs array | false

Here is an example configuration:

```js
[
    {
        pactReporter: {
            pactBroker: process.env.PACT_BROKER_HOST || 'http://localhost',
            consumerVersion: process.env.PACT_CONSUMER_VERSION || "0.0.1",
            pactFilesOrDirs: [__dirname + '/pact'],
            deletePactFilesOrDirs: true
        }
    }
]
```
npm package: @mattersmedia/article-json-to-apple-news
Description: Render article JSON in the Apple News format
Author: mic.com
Latest version: 4.3.3

# article-json-to-apple-news
Render [article json](https://github.com/micnews/html-to-article-json#format) in [Apple News format](https://developer.apple.com/library/ios/documentation/General/Conceptual/Apple_News_Format_Ref/index.html)

[![Build Status](https://travis-ci.org/micnews/article-json-to-apple-news.svg?branch=master)](https://travis-ci.org/micnews/article-json-to-apple-news)

## Usage

```
npm install article-json-to-apple-news
```

```js
const convertToAppleNews = require('article-json-to-apple-news');
const article = {
  title: 'Article Title',
  author: {
    name: 'John',
    href: 'http://example.com/john'
  },
  publishedDate: new Date('2016-02-04T14:00:00Z'),
  body: [
    {
      type: 'paragraph',
      children: [
        {
          type: 'text',
          content: 'This is the text and '
        },
        {
          type: 'text',
          bold: true,
          content: 'some bold text '
        },
        {
          type: 'text',
          href: 'http://example.com',
          content: 'some link'
        }
      ]
    },
    {
      type: 'embed',
      embedType: 'image',
      src: 'http://example/image.jpg',
      width: 300,
      height: 150
    }
  ]
};

console.log(convertToAppleNews(article, { identifier: 'article-identifier' }));
// {
//   article: <apple news article>,
//   bundlesToUrls: <object that maps bundle:// urls to http(s) urls>
// }
```

### Body format

https://github.com/micnews/html-to-article-json#format

## License

MIT
npm package: @mattersmedia/article-json-to-fbia
Description: transform article-json to Facebook's instant-articles
Author: mic.com
Latest version: 1.8.0

# article-json-to-fbia
Render [article json](https://github.com/micnews/html-to-article-json#format) in [Facebook Instant Article Format](https://developers.facebook.com/docs/instant-articles/reference)

[![Build Status](https://travis-ci.org/micnews/article-json-to-fbia.svg?branch=master)](https://travis-ci.org/micnews/article-json-to-fbia)

## Usage

```
npm install article-json-to-fbia
```

```js
const convertToFbia = require('article-json-to-fbia');
const articleJson = [
  {
    type: 'paragraph',
    children: [
      {
        type: 'text',
        content: 'This is the text and '
      },
      {
        type: 'text',
        bold: true,
        content: 'some bold text '
      },
      {
        type: 'text',
        href: 'http://example.com',
        content: 'some link'
      }
    ]
  },
  {
    type: 'embed',
    embedType: 'image',
    src: 'http://example/image.jpg',
    width: 300,
    height: 150
  }
]
;

console.log(convertToFbia(articleJson));
```

### Body format

https://github.com/micnews/html-to-article-json#format

## License

MIT
npm package: @mattersmedia/embeds
Description: Parse & render embeds
Author: mic.com
Latest version: 2.15.0

# embeds

A javascript module to parse and render embeds - such as images, video, youtube, facebook etc.

Can be used in the browser (through browserify) and node.js.

## Installation

```shell
npm install embeds --save
```

## Usage/example

The following is an example, using embeds together with [query-dom](https://www.npmjs.com/package/query-dom) so that it can be run in node.js

When used in the browser, a browser DOM element can be used instead.

```js
import {parse} from 'embeds';
import queryDom from 'query-dom';

// embed code for an embed, in this example a simple youtube embed.
// see all supported embeds further down
const embedCode = '<iframe src="https://www.youtube.com/embed/pDVmldTurqk"></iframe>';
const parsed = parse(queryDom(embedCode));
```

You can also parse input, such as a url.

```js
import {parseInput} from 'embeds';

const parsed = parseInput('https://www.youtube.com/embed/pDVmldTurqk');
```

For more examples, please see the [tests](https://github.com/micnews/embeds/tree/master/test).
npm package: @mattersmedia/html-to-article-json
Description: Converting HTML to article-json
Author: mic.com
Latest version: 1.22.0

# html-to-article-json[![Build Status](https://travis-ci.org/micnews/html-to-article-json.svg?branch=master)](https://travis-ci.org/micnews/html-to-article-json)

**html-to-article-json** parses & normalizes html to a well-structured & easy to use article json format.

The parsing logic is based on real articles - with sometimes very weird html - so please open an issue if some html doesn't get parsed correctly!

## Installation

```shell
npm install html-to-article-json
```

## Usage

### node.js

```js
var htmlToArticleJson = require('html-to-article-json')();
var htmlString = '<p>Foo<b>bar</b></p>';
var articleJson = htmlToArticleJson(htmlString);
```

### browserify

Using browseriy html-to-article-json can also use DOM as input in the browser!

```js
var htmlToArticleJson = require('html-to-article-json')();
var domElement = document.querySelector('article');
var articleJson = htmlToArticleJson(domElement);
```

## Format

`article-json` consists of a list of nodes, each node representing a block of content.

Please see the example (`npm run example`) for a simple WYSIWYG editor & the corresponding article json.

### Text

```json
{
  "type": "paragraph",
  "children": [{
    "type": "text",
    "content": "Hello, ",
    "href": null,
    "italic": false,
    "bold": false
  }, {
    "type": "text",
    "content": "mic.com",
    "href": "http://www.mic.com",
    "italic": true,
    "bold": false
  }]
}
```

The above is an example of a text node - corresponding to something like `<p>Hello, <a href="mic.com"><b>mic.com</b></a>`.

A text content node is defined by it's visual representation rather than it's code - so `html-to-article-json` will parse `<a href="mic.com"><b>mic.com</b></a>` and `<b><a href="mic.com">mic.com</a></b>` to the same json object.

Valid text nodes are `paragraph`, `header1`, `header2`, `header3`, `header4`, `header5` & `header6`.

### Embeds

```json
{
  "type": "embed",
  "embedType": "youtube",
  "youtubeId": "eBYFOJxZx4Q",
  "caption": [{
    "type": "text",
    "content": "Here's a video from ",
    "href": null,
    "italic": false,
    "bold": false
  }, {
    "type": "text",
    "content": "mic.com",
    "href": "http://www.mic.com",
    "italic": true,
    "bold": false
  }]
}
```

The above is an example of an embed node - corresponding to a youtube embed. The caption format is the same as the `children` array we have in the `Text` example.
npm package: @mattersupply/cli
Description: Matter Supply CLI
Author: @mattersupply.co
Latest version: 1.0.0

# @mattersupply/cli

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/@mattersupply/cli.svg)](https://npmjs.org/package/@mattersupply/cli)
[![Downloads/week](https://img.shields.io/npm/dw/@mattersupply/cli.svg)](https://npmjs.org/package/@mattersupply/cli)
[![License](https://img.shields.io/npm/l/@mattersupply/cli.svg)](https://github.com/mattersupply/cli/blob/master/package.json)

## Matter Supply CLI

The Matter Supply CLI is a tool that is used for Matter Supply Projects to:

- Manage Environment Configurations via AWS SSM: `matter config`
- ... more.

At the core is a configuration structure for every project. Every project should have a `matter.yml` file.
If your config file is somewhere else, you can always set the path via `matter -c path/to/config.yml`.

<!-- toc -->
* [@mattersupply/cli](#mattersupplycli)
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->

# Usage

<!-- usage -->
```sh-session
$ npm install -g @mattersupply/cli
$ matter COMMAND
running command...
$ matter (--version)
@mattersupply/cli/1.0.0 linux-x64 node-v16.20.0
$ matter --help [COMMAND]
USAGE
  $ matter COMMAND
...
```
<!-- usagestop -->

# Commands

<!-- commands -->
* [`matter help [COMMANDS]`](#matter-help-commands)

## `matter help [COMMANDS]`

Display help for matter.

```
USAGE
  $ matter help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for matter.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_
<!-- commandsstop -->
npm package: @mattetti/custom-api-documenter
Description: Read JSON files from api-extractor, generate documentation pages
Author: Matt Aimonetti
Latest version: 0.3.3

# @mattetti/custom-api-documenter a fork of @microsoft/api-documenter

This tool can be used to generate an online API reference manual for your TypeScript library.
It reads the *.api.json data files produced by [API Extractor](https://api-extractor.com/),
and then generates files in [Markdown](https://en.wikipedia.org/wiki/Markdown) format with some HTML.

For usage information, see the
[Generating Docs](https://api-extractor.com/pages/setup/generating_docs/) article from the API Extractor
documentation.

## Customization

The markdown renderer was customized to better render API docs using
[hugo](https://gohugo.io/) and to allow for a different file structure.

Custom json options not available in the original api-documenter markdown:

- uriRoot: so the doc can generate links for api docs not hosted at the root of the domain.
- onlyPackagesStartingWith: a string used to filter packages to document, useful when you want to publish only document some packages.


```
{
  "outputTarget": "markdown",
  "newlineKind": "lf",
  "uriRoot": "/apis",
  "onlyPackagesStartingWith": "@mything"
}
```
npm package: @matteusan/himig
Description: Matteu's personal design system for building user interfaces.
Author: Matteu
Latest version: 1.9.0

## Prerequisites
Be sure to have [NodeJS](https://nodejs.org) LTS installed. Any other version will risk the project breaking in
development.
This design system is dependent on the CSS preprocessor, [Sass](https://sass-lang.com). When using Sass, **be sure to
use DartSass instead of the now deprecated LibSass (node-sass)**.

## Setup
```sh
$ npm i @matteusan/himig @matteusan/pintig --save

# or

$ pnpm add @matteusan/himig @matteusan/pintig
```
```scss
// main.scss

@use 'pkg:@matteusan/himig';
@use 'pkg:@matteusan/himig/ms-button';

@include himig.init {
  @include ms-button.render();
}
```

## Contributing
Contributing guidelines are located [here](https://github.com/MatteuSan/himig/tree/main/.github/CONTRIBUTING.md).
npm package: @matteusan/himig-web
Description: MatteuSan's personal design system's web implementation.
Author: Matteu
Latest version: 0.1.7

# Himig
MatteuSan's personal design system for personal projects.

## Installation
```sh
yarn add @matteusan/himig-web --save
```

## Documentation
- The documentation of this library can be found [here](https://docs.matteusan.me/docs/himig).