open-index/open-npm huggingface dataset:
npm package: @financial-times/ip-custom-errors
Description: Generates custom Http errors
Author: Internal Products
Latest version: 1.0.1

# ip-custom-errors

[![npm version](https://badge.fury.io/js/%40financial-times%2Fip-custom-errors.svg)](https://badge.fury.io/js/%40financial-times%2Fip-custom-errors)
[![CircleCI](https://circleci.com/gh/Financial-Times/ip-custom-errors.svg?style=svg&circle-token=3dd30815e8d7254babcade4bf0bf33c178925c79)](https://circleci.com/gh/Financial-Times/ip-custom-errors)

A module that generates custom HTTP errors

## setup

Install via npm:

```sh
  npm i -S @financial-times/ip-custom-errors
```

## Usage

The module exposes three methods to generate the custom HTTP errors. You can use the one that fits your needs as follows:

### Using the custom HttpError constructor to create a custom error message, for example: 
```javascript
const { HTTPError } = require('@financial-times/ip-custom-errors');
try {
  ...
  throw new HTTPError(401,'Unauthorized','You are not allowed to access this resource')
} catch (err) {
  console.error(err)
}

```
### Using the custom HTTPStatusError method with status code and custom message, for example:

```javascript
const { HTTPStatusErrors } = require('@financial-times/ip-custom-errors');
try {
  ...
  throw HTTPStatusErrors['400']('You are not allowed to access this resource')
} catch (err) {
  console.error(err)
}
```

### Using the name of the custom error by name
```javascript
const { NotFound } = require('@financial-times/ip-custom-errors');
try {
  ...
  throw NotFound("The resource you requested can't be found");
} catch (err) {
  console.error(err)
}
```
#### List of error names to use 
 
||||
|:-----------------------------|:--------------------------|:-----------------------------|
| BadRequest                   | UnsupportedMediaType      | NotImplemented               |       
| Unauthorized                 | RangeNotSatisfiable       | BadGateway                   |          
| PaymentRequired              | Expectation               | HttpVersionNotSupported      |  
| Forbidden                    | MisdirectedRequest        | VariantAlsoNegotiates        |   
| NotFound                     | UnprocessableEntity       | InsufficientStorage          |  
| MethodNotAllowed             | Locked                    | LoopDetected                 |  
| NotAcceptable                | UnorderedCollection       | NotExtended|                 |
| ProxyAuthenticationRequired  | UpgradeRequired           | NetworkAuthenticationRequired|        
| RequestTimeout               | PreconditionRequired      | ServiceUnavailable           |                           
| Conflict                     | TooManyRequests           | GatewayTimeout               |
| Gone                         | UnavailableForLegalReasons| BandwidthLimitExceeded       |
| LengthRequired               | InternalServerError       |
| PreconditionFailed           | ImATeapot                 |
| PayloadTooLarge              | FailedDependency          |
| UriTooLong                   | RequestHeaderFieldsTooLarge |




























## Licence

MIT
npm package: @financial-times/ip-whitelist
Description: Checks if a user belongs to the given whitelist
Author: Internal Products
Latest version: 0.0.1

# ip-whitelist

[![npm version](https://badge.fury.io/js/%40financial-times%2Fip-whitelist.svg)](https://badge.fury.io/js/%40financial-times%2Fip-whitelist)
[![CircleCI](https://circleci.com/gh/Financial-Times/ip-whitelist.svg?style=svg&circle-token=d30869d5156c101c87d7e3ef94b88617c54795b9)](https://circleci.com/gh/Financial-Times/ip-whitelist)

This module is an express middleware that can verify if a user belongs to a whitelist. 

## Setup
```javascript

  npm install -S @financial-times/ip-whitelist

```

## Usage
Set the whitelist data to the *app.locals* object in your application. Then call this middleware after the [s3o-middleware]("https://www.npmjs.com/package/@financial-times/s3o-middleware")
```javascript
var authS3O = require('@financial-times/s3o-middleware');
var whitelist = require('@financial-times/ip-whitelist');
const whitelistData = require('route to your whitelist data');
...
const app = express();
app.locals.whitelistData = whitelistData;
app.use(authS3O);
app.use(whitelist);
...
```
## Licence
   MIT
npm package: @financial-times/ip-wxp-scripts
Description: command line scripts for Worker XP
Author: Internal Products
Latest version: 1.0.7

# ip-wxp-scripts

[![npm version](https://badge.fury.io/js/%40financial-times%2Fip-wxp-scripts.svg)](https://badge.fury.io/js/%40financial-times%2Fip-wxp-scripts) 
[![CircleCI](https://circleci.com/gh/Financial-Times/ip-wxp-scripts.svg?style=shield&circle-token=f52aac031860d78870464585cf57b6247f28e3c2)](https://circleci.com/gh/Financial-Times/ip-wxp-scripts)



This module provides a set of commands that can be used to run mocha with different configurations on a project. This can be imported into each project thereby eliminating the need to setup mocha configuration on each project individually.

## Setup
```javascript

  npm install -D @financial-times/ip-wxp-scripts

```
## Usage
The following commands can be used with this module: <br>
```javascript

ip mocha [option] [globs] 

```
Where _**option**_ can be : _all_ | _server_ | _client_ | _snapshots_ | _debug_ | _report_<br><br>
If no _**option**_ is provided the default value will be '_all_' and _**globs**_ is the glob pattern you want to include in your test run, if no _**glob**_ provided default value will be '_**/*.spec.js_'.

**ip mocha all**: runs the tests specified in default value of _**globs**_ with all of the mocha configuration ie server, dom, snapshots.

**ip mocha server _globs_**: runs the tests specified in _**globs**_ with basic mocha configuration.

**ip mocha dom _globs_**: runs the tests specified in _**globs**_ with basic mocha and dom congifuration.

**ip mocha snapshots _globs_**: runs the tests specified in _**globs**_ with basic mocha and snapshot congifuration.

**ip mocha reshoot _globs_**: runs the snapshot command with process.env.CHAI_JEST_SNAPSHOT_UPDATE_ALL set to true, to allow capturing the snapshots required for the tests.

**ip mocha [option] [glob] --report**: runs tests as per the _option_ and _glob_ and runs report task to create reports on coverage.

**ip mocha [option] [glob] --inspect-brk|inspect[=XXXX]**: runs tests as per _option_ and _glob_ , with inspector agent enabled at default port 9229, if no port is provided as an argument on the command line.
npm package: @financial-times/jest-bower-resolver
Description: Resolver for jest to resolve bower components correctly by reading the bower.json file
Author: Jake Champion
Latest version: 1.0.2

# jest-bower-resolver

This package is for jest to resolve bower components correctly by reading the bower.json file.

## Usage

1. install the package

   ```
   $ npm i -D jest-bower-resolver
   ```

2. add `jest-bower-resolver` as the resolver of jest, and
   `transformIgnorePattern` so that the package missing `main` field can be
    transpiled correctly when running jest.

   In your package.json, please add them as follows:

   ```json
   {
     ...
     "jest": {
       ...
       "resolver": "jest-bower-resolver"
     }
   }
   ```
npm package: @financial-times/jest-browser-resolver
Description: Resolver for jest to resolve using the `package.json` "browser" field first and falling back to the default behaviour of Jest.
Author: Jake Champion
Latest version: 1.0.2

# @financial-times/jest-browser-resolver

This package is for jest to resolve using the `package.json` "browser" field first and falling back to the default behaviour of Jest.

## Usage

1. install the package

   ```
   $ npm i -D @financial-times/jest-browser-resolver
   ```

2. add `jest-browser-resolver` as the resolver of jest.

   If configuring Jest via your package.json, please add them as follows:

   ```json
   {
     ...
     "jest": {
       ...
       "resolver": "@financial-times/jest-browser-resolver"
     }
   }
   ```

   If configuring Jest via a jest.config.js file:

   ```json
   {
     ...
     "resolver": "@financial-times/jest-browser-resolver",
   }
   ```
npm package: @financial-times/js-features-analyser
Description: ## How to use
Author: Jake Champion
Latest version: 0.4.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# JavaScript Feature Analyser

A Node.js command-line application for figuring out what standard-library features are being used within a JavaScript file.

[![NPM version](https://img.shields.io/npm/v/@financial-times/js-features-analyser.svg)](https://www.npmjs.com/package/@financial-times/js-features-analyser)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)][license]

```bash
> npx @financial-times/js-features-analyser analyse --file bundle.js
```


## Table Of Contents

  - [Usage](#usage)
  - [Limitations](#limitations)
  - [Contributing](#contributing)
  - [Publishing](#publishing)
  - [Contact](#contact)
  - [Licence](#licence)


## Usage

This project requires [Node.js] 10.x and [npm]. You can install with:

```sh
npm install @financial-times/js-features-analyser
```

## Limitations

This project does not compile syntax at all.

Create a bundle which targets the syntax level you support (ES3/5/2017/2019) and then pass that bundle through this tool.

The reason to create the bundle first is because if you are compiling your code down to another syntax level, the compiled code will contain different built-ins than the uncompiled version. E.G. Compiling `async function() { await 7;}` to ES5 will make the compiled output have `Promise` in it, which this tool will then detect.

This project does not know the types that are within the code being analysed, which means that when it sees a name of a builtin being used, it will add all the builtins which match that name to it's output. E.G. Analysing `[1].reduce(function(){})` will not only detect that `Array.prototype.reduce` was used, it would also incorrectly detect that `Int8Array.prototype.reduce`, `Uint8Array.prototype.reduce`, `Uint8ClampedArray.prototype.reduce`, `Int16Array.prototype.reduce`, `Uint16Array.prototype.reduce`, `Int32Array.prototype.reduce`, `Uint32Array.prototype.reduce`, `Float32Array.prototype.reduce`, and `Float64Array.prototype.reduce` were also used.


## Contributing

This module has a full suite of unit tests, and is verified with ESLint. You can use the following commands to check your code before opening a pull request:

```sh
npm test    # verify JavaScript code with ESLint and run the tests
```


## Publishing

New versions of the module are published automatically by CI for every commit which lands on the `master` branch.


## Contact

If you have any questions or comments about this module, or need help using it, please [raise an issue][issues].


## Licence

This software is under the [MIT licence][license].



[issues]: https://github.com/Financial-Times/js-features-analyser/issues
[license]: http://opensource.org/licenses/MIT
[node.js]: https://nodejs.org/
[npm]: https://www.npmjs.com/
npm package: @financial-times/karma-proclaim
Description: Proclaim assertion library for Karma
Author: Bradley C Bailey
Latest version: 1.1.2

karma-proclaim
==========

[Proclaim](https://github.com/rowanmanning/proclaim) assertion library for [Karma](http://karma-runner.github.io).

Proclaim is a simple assertion library for server and client side JavaScript.
It can be used with most test frameworks and is compatible with IE6+. Proclaim
is an attempt to achieve the simplicity of
[Node.js assert](http://nodejs.org/api/assert.html) with the extra assertions
of [Chai](http://chaijs.com/).


Installation
------------

Install the plugin from npm:

```sh
$ npm install @financial-times/karma-proclaim --save-dev
```

Or from Github:

Add `proclaim` to the `frameworks` key in your Karma configuration:

```js
module.exports = function(config) {
  config.set({
    // frameworks to use
    frameworks: [ 'mocha', 'proclaim' ]

    // ...
  });
});
```


Usage
-----

```js
describe('mocha tests with proclaim', function() {
  it('should expose proclaim', function() {
    proclaim.ok('everything', 'everything is ok');
    proclaim.notEqual('foo', 'bar');
    proclaim.isTrue(true);
  });
});
```
npm package: @financial-times/kat-client-proxies
Description: A library of client proxies for various ft platform apis
Author: kat@ft.com
Latest version: 4.0.2

# kat-client-proxies
A library of client proxies for use with various APIs used by KAT.

KAT (Knowledge & administration tools) is an ft.com application created for Financial Times B2B clients.

## Getting started


`$ git clone git@github.com:Financial-Times/kat-client-proxies.git`

Standard next app `make` tasks apply:

`make intall`
`make .env`
`make test`

Whenever you are adding a new client proxies, for maintenance don't forget to include it in the list in the end of this README.

## Testing
`$ npm test` will by default use the mocked APIs and associated fixtures. In some cases it is possible to test against the actual APIs by setting the following environment variables:

```
USE_MOCK_API=false
USER_UUID=
LICENCE_UUID=
```

Where `USER_UUID` is a valid user uuid on FT.com and `LICENCE_UUID` is the uuid of the licence associated with `USER_UUID`. Feel free to approach KAT team via `#ft-syndikat` slack channel if you have any questions.

## Deployment
This module has been created to be included throughout other KAT components.

### How to update a repo that uses the module to the new version
If you want to update connected components with the latest version, you need to follow the following steps:
1. Create a new repository release on GitHub. Please follow naming convention of previous releases.
2. Go to `package.json` file of the component you want to update, and change `"kat-client-proxies"` dependency version to the [newly released one](https://github.com/Financial-Times/kat-client-proxies/releases).

The following KAT components are currently using `kat-client-proxies`:
- [kat-overview](https://github.com/Financial-Times/kat-overview)
- [kat-myft](https://github.com/Financial-Times/kat-myft)
- [kat-usage-report](https://github.com/Financial-Times/kat-usage-report)
- [kat-myft-syncher] (https://github.com/Financial-Times/kat-myft-syncher)
- [kat-api] (https://github.com/Financial-Times/kat-api)
- [kmt-utilities] (https://github.com/Financial-Times/kmt-utilities)

### How to use the module

#### Installation guide

Include `"kat-client-proxies": "financial-times/kat-client-proxies#v[LATEST_RELEASE_VERSION]"` as a dependency in your package.json. [Information about the latest version](https://github.com/Financial-Times/kat-client-proxies/releases).

#### Usage

In your application wherever you would like to use kat-client-proxies include the path to the code you want to use:

```js
//... your app code
const [moduleName] = require('kat-client-proxies').[moduleName];
// ... and then e.g.
[moduleName].[functionName]([args...])
```

## Current proxies
* accessLicenceClient
* acquisitionCtxClient
* clientErrors
* elasticSearchClient
* emailNotification
* facetsClient
* kinesisClient
* licenceDataClient
* myFTClient
* sessionClient
* syncUserFollows
* userProfileClient