open-index/open-npm huggingface dataset:
npm package: @rpmadden08/browser-logs-with-local-storage
Description: Datadog browser logs library.
Latest version: 1.0.4

# `logs`

Datadog browser logs library.

[Browser support](./BROWSER_SUPPORT.md#logger)

## Setup

### NPM

```
import { datadogLogs } from '@rpmadden08/browser-logs-with-local-storage'
datadogLogs.init({
  clientToken: 'XXX',
  datacenter: 'us',
  forwardErrorsToLogs: true,
  sampleRate: 100
})
```

### Bundle

```
<script src = 'https://www.datadoghq-browser-agent.com/datadog-logs-us.js'>
<script>
  window.DD_LOGS.init({
    clientToken: 'XXX',
    datacenter: 'us',
    forwardErrorsToLogs: true,
    sampleRate: 100
  });
</script>
```

## Public API

What we call `Context` is a map `{key: value}` that will be added to the message context.

- Init must be called before other methods. Configurable options:

  - `isCollectingError`: when truthy, we'll automatically forward `console.error` logs, uncaught exceptions and network errors.
  - `sampleRate`: percentage of sessions to track. Only tracked sessions send logs.
  - `datacenter`: defined to which datacenter we'll send collected data ('us' | 'eu')

  ```
  init(configuration: {
      clientToken: string,
      datacenter?: string,
      isCollectingError?: boolean,
      sampleRate?: number
  })
  ```

- Default logger

  ```
  logger.debug | info | warn | error (message: string, messageContext = Context)`
  logger.log (message: string, messageContext: Context, status? = 'debug' | 'info' | 'warn' | 'error')
  logger.setLevel (level?: 'debug' | 'info' | 'warn' | 'error')
  logger.setHandler (handler?: 'http' | 'console' | 'silent')
  logger.addContext (key: string, value: any)  # add one key-value to the logger context
  logger.setContext (context: Context)  # entirely replace the logger context
  ```

- Custom loggers

  Custom loggers have the same API than the default logger

  ```
  createLogger (name: string, conf?: {
      level?: 'debug' | 'info' | 'warn' | 'error'
      handler?: 'http' | 'console' | 'silent'
      context?: Context
  })  # create a new logger
  getLogger (name: string)  # retrieve a previously created logger
  ```

- Modify the global context for all loggers
  ```
  addLoggerGlobalContext (key: string, value: any)  # add one key-value to the default context
  setLoggerGlobalContext (context: Context)  # entirely replace the default context
  ```

## TypeScript support

Types are compatible with TypeScript >= 3.0.
For earlier version, you can import js sources and use global variable to avoid any compilation issue:

```
import '@rpmadden08/browser-logs-with-local-storage/bundle/datadog-logs-us';

window.DD_LOGS.init({
  clientToken: 'XXX',
  datacenter: 'us',
  forwardErrorsToLogs: true,
  sampleRate: 100
});
```
npm package: @rpmadden08/browser-rum-with-local-storage
Description: Datadog browser rum library.
Latest version: 1.0.3

# `rum`

Datadog browser rum library.

## Setup

### NPM

```
import { datadogRum } from '@rpmadden08/browser-rum-with-local-storage'
datadogRum.init({
  applicationId: 'XXX',
  clientToken: 'XXX',
  datacenter: 'us',
  resourceSampleRate: 100,
  sampleRate: 100
})
```

### Bundle

```
<script src = 'https://www.datadoghq-browser-agent.com/datadog-rum-us.js'>
<script>
  window.DD_RUM.init({
    applicationId: 'XXX',
    clientToken: 'XXX',
    datacenter: 'us',
    resourceSampleRate: 100,
    sampleRate: 100
  });
</script>
```

## Public API

- Init must be called to start the tracking. Configurable options:

  - `sampleRate`: percentage of sessions to track. Only tracked sessions send rum events.
  - `resourceSampleRate`: percentage of tracked sessions with resources collection.
  - `datacenter`: defined to which datacenter we'll send collected data ('us' | 'eu')

  ```
  init(configuration: {
      applicationId: string,
      clientToken: string,
      datacenter?: string,
      resourceSampleRate?: number
      sampleRate?: number
  })
  ```

- Modify the global context

  ```
  addRumGlobalContext (key: string, value: any)  # add one key-value to the default context
  setRumGlobalContext (context: Context)  # entirely replace the default context
  ```

- Add user action

  ```
  addUserAction (name: string, context: Context)
  ```

## TypeScript support

Types are compatible with TypeScript >= 3.0.
For earlier version, you can import js sources and use global variable to avoid any compilation issue:

```
import '@rpmadden08/browser-rum-with-local-storage/bundle/datadog-rum-us';

window.DD_RUM.init({
  applicationId: 'XXX',
  clientToken: 'XXX',
  datacenter: 'us',
  resourceSampleRate: 100,
  sampleRate: 100
});
```
npm package: @rpmanetworks/casbin
Description: An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS
Latest version: 5.19.4

# Node-Casbin

Modified version of `node-casbin` version `5.19.3` to be used in a webpack 5 project and run in browser.

Tested using NodeJS 16

## Changes:

- replaced `picomatch` with `minimatch` as a glob pattern matcher for use by `globMatch` in your Casbin model.

## Known limitations:

The following tests are failing:

```typescript
expect(util.globMatch('/foo', '*/foo')).toEqual(true);
expect(util.globMatch('/foo', '*/foo*')).toEqual(true);
expect(util.globMatch('/foo', '*/foo/*')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo*')).toEqual(false);
expect(util.globMatch('/foo/bar', '*/foo/*')).toEqual(true);
expect(util.globMatch('/foobar', '*/foo')).toEqual(false);
expect(util.globMatch('/foobar', '*/foo*')).toEqual(true);
```

and have been commented. `picomatch` with `minimatch` are not 100% compatible, each one has its features over the other, please search the internet for comparisons. Please check `https://github.com/isaacs/minimatch` for `minimatch` documentation.

## NOTE

> Original `Node-Casbin` [README.md](./README-original.md) is [here](./README-original.md)