open-index/open-npm huggingface dataset:
npm package: @kwsites/cms-common
Description: Common tools used for the apostrophe cms plugins from kwsites
Author: Steve King
Latest version: 0.6.0


# @kwsites/cms-common

Utilities depended upon by many of the `@kwsites/cms-*` modules.

## Getting Started

Initialise the module in your `app.js` before any other `@kwsites/cms-` modules:

```javascript
apostrophe({
  modules: {
    '@kwsites/cms-common': {},
      
    // ... other @kwsites/cms-* modules
  }
});
```

The `@kwsites/cms-common` module uses the moog bundle option to  `improve` some of the apostrophe internal modules to add the
features other modules then depend upon. Full details below:

## apostrophe-assets

`@kwsites/cms-common` adds variables and mixins for use in the `.less` files of your application or the modules it imports.

Most importantly, this module adds the variables used in layouts, to override these values set their values in your own
project as `lib/modules/apostrophe-assets/public/css/kwsites/mixins.less`:

```css
/* pixel widths to use to determine the @media queries for mobile, tablet, desktop
   and not-mobile (which covers both tablet and desktop) */
@website-width:            1200px;
@mobile-site-width:        414px; 

/* padding to use in components, the small/large padding variants are set as being
   a half / double the default padding size unless explicitly specified */
@padding-size:             1rem;

@padding-size-s:           @padding-size / 2;
@padding-size-l:           @padding-size * 2;
```
npm package: @kwsites/cms-email
Description: Email templates and delivery compatible with the apostrophe cms
Author: Steve King
Latest version: 1.0.0


# @kwsites/cms-email

A set of modules for the [apostrophe cms](https://apostrophecms.org/) that simplifies the
handling of 'subscriber' pieces (people who sign up to receive notifications from you)
and 'email' pieces .

Configure the module with options:

- `emailHost` the host to connect to
- `emailPort` the port number on the remote SMTP host
- `transport` an optional object of properties to merge into the nodemailer transport configuration

By installing this module, you also have access to the bundled modules listed below:

## @kwsites/cms-subscriber

An extension of [apostrophe-pieces](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-pieces) used to
capture registration and contact details for your subscribers.

## @kwsites/cms-subscriber-pages

Ensure you have added a `@kwsites/cms-subscriber-pages` type page to your website - this will
be the page used as the subscription management page in the emails that get sent out.

## @kwsites/cms-subscriber-widgets

Add a widget of type `@kwsites/cms-subscriber-widgets` to your website to capture user's names
and email addresses. Configure the widget with a 'Registration Source' to add the user to that
named group.

Using this widget requires that your project sets the following variables in less:

- @kwsites-button-border-color
- @kwsites-button-border-radius
- @kwsites-button-border-width
- @kwsites-button-enabled-color
- @kwsites-button-disabled-background
- @kwsites-button-disabled-color
- @kwsites-button-enabled-background
- @kwsites-enabled-input-color
- @kwsites-button-enabled-color
- @kwsites-input-margin
npm package: @kwsites/cms-images
Description: Configurable image gallery compatible with the apostrophe cms
Author: Steve King
Latest version: 1.5.7


# @kwsites/cms-images

Extensions for working with images in an  [apostrophe](https://apostrophecms.org/) backed application.

## What you get

This module includes an 'improve' to the
[apostrophe-images](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-images) and
[apostrophe-images-widgets](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-images-widgets)
modules.

### apostrophe-images

- Adds support for tag filtering in the image manage / search dialog. Enabled by default but can
  be disabled by setting `apostrophe-images: { showTagFilter: false }`

### apostrophe-images-widgets

- Gallery mode image re-ordering with drag & drop: when showing a gallery of images, drag the
  thumbnails to re-order the images. (Disable with `apostrophe-images-widgets: { enableRouteReorder: false }`)
- Gallery expanded mode image re-focusing: when showing the expanded view of a single image from
  a gallery, allows for setting the focal point of the image by clicking in the image without needing
  to launch the image editor. (Disable with `apostrophe-images-widgets: { enableRouteFocalPoint: false }`)
- Adds support for layout selection based on the number of images chosen.

## How to include it

Install with `npm i @kwsites/cms-images` or `yarn add @kwsites/cms-images`.

Ensure your application also has a dependency on [@kwsites/cms-common](https://github.com/kwsites/cms-common),
which provides the less plugins used by this library to generate its theme.

Add the usual import to your `app.js`:

```
apostrophe({
   modules: {

      '@kwsites/cms-common': {},
      '@kwsites/cms-images': {},

   }
});
```

## Post-Install

At the time of publishing, [Apostrophe CMS](https://apostrophecms.org/) doesn't automatically support `@scoped/` dependency modules,
which causes an error when the CMS starts up and is unable to symlink the source of the modules into the `/public` folder correctly.

To resolve this, you need to manually create the directory `/public/modules/@kwsites` before starting the server. To have this run
automatically after installing dependencies, add the following to your `package.json` `scripts` block:

```json
{
  "scripts": {
    "postinstall": "mkdir -p ./public/modules/@kwsites"
  }
}
```
npm package: @kwsites/cms-seo
Description: SEO enhancements for apostrophe cms
Author: Steve King
Latest version: 1.5.0


# @kwsites/cms-seo

Search engine optimising helpers for [apostrophe](https://apostrophecms.org/) backed applications.

## What you get

This module includes an 'improve' to the 
[apostrophe-doc-type-manager](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-doc-type-manager) to add
a new `seo` field to all modules that extend either 
[apostrophe-pieces](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-pieces)
or [apostrophe-custom-pages](https://docs.apostrophecms.org/apostrophe/modules/apostrophe-custom-pages)
unless that module is configured with `seoEnabled: false` in its options.

The `seo` schema is `{ description: 'string', 'image': 'apostrophe-images' }` by default, this can be
modified by overriding the `seoFields` option.

Your templates can then make use of `data.page.seo` or `data.piece.seo` to access your seo data. 

## How to include it

Add the usual import to your `app.js`:

```
apostrophe({
   modules: {

      '@kwsites/cms-seo': {
         site: 'My Website Name',
         twitter: '@my-user-name',
      },

   }
});
```

Your `apostrophe-pieces` and `apostrophe-custom-pages` editors will now show an `SEO` section. To include
the SEO friendly meta data, edit your `outerLayout.html` to include the provided template:

```
 {%- include "@kwsites/cms-seo:meta.html" -%}
``` 

## How to customise it


```
apostrophe({
   modules: {

      '@kwsites/cms-seo': {

         // set the name used in the title      
         site: 'My Website Name',
         
         // set your username, or empty string / false if not using twitter
         twitter: '@my-user-name',

         // disable a meta section by setting it to false
         'canonical': false,

         // or use a custom template for a meta section by setting it an file name
         'openGraph': 'my-custom-template.html',
      },
   }
});
```
npm package: @kwsites/commands
Description: Command line arguments reader
Author: Steve King
Latest version: 1.0.3

Overview
========

Simplify access to command line arguments in node apps, and query string or hash parsing in the browser environment.

Installation
============

If using in node, installation via npm is as simple as `npm install @kwsites/commands`.

API
===

`Commands.get( key [, defaultValue] )` get the value of a named argument, or when that argument wasn't supplied get the supplied default value.

`Commands.exists( key )` get a boolean flag for whether a named argument was supplied

Usage - node.js
===============

Include Commands with require, then read command line arguments in camel case:

```javascript
const commands = require('@kwsites/commands');
console.log( Commands.get('someArg') );  // outputs "foo"
console.log( Commands.get('someUnknownArg', 'defaultValue') );  // outputs "defaultValue"
console.log( Commands.exists('someUnknownArg') );  // outputs false
console.log( Commands.get('bar') );  // outputs true
console.log( Commands.get('baz') );   // outputs false
```

```
> node script.js -some-arg "foo" --bar --no-baz
```


Command line arguments can be sent either with a hyphen prefix for naming an argument where the next argument is the value of that argument (in this case "-some-arg" is converted to "someArg" and has the value "foo"). A double hyphen prefix is used to denote a flag, so here bar is true and baz is false because "--no-" is used as flag negation.

Usage - browser
===============

Including Commands as a script tag then makes available a global variable called "commands" that has the same API as in node however the data source is the query string and hash segments of the URL. Unlike in the node environment, evaluation of the arguments takes place every time they are queried to allow for changes in the hash of the page.

    console.log( commands.get('someArg') );  // outputs "foo"
    console.log( commands.get('someUnknownArg', 'defaultValue') );  // outputs "defaultValue"
    console.log( commands.exists('someUnknownArg') );  // outputs false
    console.log( commands.get('bar') );  // outputs true
    console.log( commands.get('baz') );   // outputs false

    location.href = 'somepage.html?someArg=foo&--bar&#--no-baz'

Here both the query string and hash are being used although it can be either or neither, if there are entities in the URL that are being used as options (ie: prefixed with a double hyphen) then they will still need a trailing ampersand to make the URL conform to the W3C spec.
npm package: @kwsites/file-exists
Description: Synchronous validation of a path existing either as a file or as a directory.
Author: Steve King
Latest version: 1.1.1

# @kwsites/file-exists

Synchronous validation of a path existing either as a file or as a directory.

```
const { exists, FILE, FOLDER, READABLE } = require('@kwsites/file-exists');

// check for a folder existing
assert(exists(__dirname, FOLDER));
assert(!exists(__filename, FOLDER));

// check for a file existing
assert(!exists(__filename, FILE));
assert(exists(__filename, FILE));

// when no type is specified, both folders and files are allowed
assert(exists(__dirname));
assert(exists(__filename));

// alternatively specify both files and folders
assert(exists(__dirname, FILE + FOLDER));

// or just that the path is readable (can be either a file or folder)
assert(exists(__filename, READABLE));
```

## Troubleshooting

This library uses [debug](https://www.npmjs.com/package/debug) to handle logging,
to enable logging, use either the environment variable:

```
"DEBUG=@kwsites/file-exists" node ./your-app.js 
``` 

Or explicitly enable logging using the `debug` library itself:

```javascript
require('debug').enable('@kwsites/file-exists');
```
npm package: @kwsites/math-sum
Description: Gets the sum of values
Author: Steve King
Latest version: 2.5.0

@kwsites/math-sum
===========

A lightweight library for summing numbers together. 


Usage
=====

Install using npm `npm install @kwsites/math-sum` or yarn  then use with require:

```typescript
import { sum } from '@kwsites/math-sum';

const numbers = [123, 456, 789];
const count = sum(numbers);

assert(count === 1368);
```

If the name `sum` clashes with your own variable naming, and you prefer not to alias in your imports,
you can use its alias `sumOf`;


```typescript
import { sumOf } from '@kwsites/math-sum';

const numbers = [123, 456, 789];
const sum = sumOf(numbers);

assert(sum === 1368);
```
npm package: @kwsites/promise-result
Description: Utility to transform any promise into its fulfilled value whether it resolved or rejected.
Author: Steve King
Latest version: 1.2.0


# @kwsites/promise-result

A utility to transform any promise into its fulfilled value whether it resolved or rejected.

## Usage

Capture the fulfillment result of a promise using `promiseResult`:

```typescript
import { promiseResult } from '@kwsites/promise-result';

const successValue = 'Good';
const errorValue = new Error('Bad');

expect(await promiseResult(Promise.resolve(successValue)))
  .toEqual(expect.objectContaining({
    result: successValue,
    value: successValue,
    success: true,
    threw: false
  }));

expect(await promiseResult(Promise.reject(errorValue)))
  .toEqual(expect.objectContaining({
    result: errorValue,
    error: errorValue,
    success: false,
    threw: true,
  }));
```

Capture just the rejection reason from a promise with `promiseError`:


```typescript
import { promiseError } from '@kwsites/promise-result';

const successValue = 'Good';
const errorValue = new Error('Bad');

expect(await promiseError(Promise.resolve(successValue)))
    .toBeUndefined();

expect(await promiseError(Promise.reject(errorValue)))
  .toBe(errorValue);
```
npm package: @kwswap/sdk
Description: 🛠 An SDK for building applications on top of swap.
Latest version: 0.0.10

# Pancakeswap SDK

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Actions Status](https://github.com/pancakeswap/pancakeswap-sdk/workflows/CI/badge.svg)](https://github.com/pancakeswap/pancakeswap-sdk)
[![npm version](https://img.shields.io/npm/v/@pancakeswap-lib/sdk/latest.svg)](https://www.npmjs.com/package/@pancakeswap-lib/sdk/v/latest)

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancakeswap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @kwswap/uikit
Description: Set of UI components for swap projects
Latest version: 0.0.10

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap-libs/uikit`

## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)