open-index/open-npm huggingface dataset:
npm package: @opzkit/nodeamqp
Description: An opinionated AMQP library for NodeJS
Author: Joakim Olsson
Latest version: 0.8.0

# nodeamqp

Nodeamqp provides an opinionated way of using [RabbitMQ](https://www.rabbitmq.com/) for event-driven architectures.

Getting Started
===============

Add the dependency

```shell
yarn add @opzkit/nodeamqp
```

## Usage

See the 'examples' subdirectory.

## Contributing

TODO

## References

* Official ampq [documentation](https://www.rabbitmq.com/tutorials/amqp-concepts.html)

## License

MIT - see [LICENSE](./LICENSE) for more details.

## Developing

TODO

## Tests

```bash
yarn run test
```

## Example message logger

An example message logger which dumps messages to console.

```typescript
const StdOutMessageLogger = (
  content: Buffer,
  routingKey: string,
  outgoing: boolean
) => {
  let out: string = content.toString("utf-8");
  try {
    out = JSON.stringify(JSON.parse(out), null, 2);
  } catch (e) {
    // Ignore errors since out is already set
  }
  if (outgoing) {
    console.log(
      `Sending using routingkey: '${routingKey}' with content:\n${out}\n`
    );
  } else {
    console.log(
      `Received from routingkey '${routingKey}' with content:\n${out}\n`
    );
  }
};
```
npm package: @opzlab/log-finder-ruleset
Description: Terra standard ruleset for well known log patterns
Author: Terraform Labs, PTE.
Latest version: 3.1.0

# @terra-money/log-finder-ruleset

Terra standard ruleset for well known log patterns

## Example codes

```typescript
import {
  createActionRuleSet,
  createAmountRuleSet
  createLogMatcherForActions,
  createLogMatcherForAmounts,
  getTxCanonicalMsgs,
  getTxAmounts
} from "@terra-money/log-finder-ruleset"

// https://phoenix-lcd.terra.dev/cosmos/tx/v1beta1/txs/:txhash

const tx = {
  "height": ...,
  "txhash": ...,
  "raw_log": ...,
  "logs": ...,
  "gas_wanted": ...,
  "gas_used": ...,
  "tx": ...,
  "timestamp": ...,
}
const address = "terra1..."
const network = "mainnet"

// getTxCanonicalMsgs
const actionRuleset = createActionRuleSet(network)
const actionLogMatcher = createLogMatcherForActions(actionRuleset)
const actionMatchedMsg = getTxCanonicalMsgs(tx, actionLogMatcher)

console.log(actionMatchedMsg)


// getTxAmountInfo
const amountRuleset = createAmountRuleSet(network)
const amountLogMatcher = createLogMatcherForAmounts(amountRuleset)
const amountMatchedMsg = getTxAmounts(tx, amountLogMatcher, address)

console.log(amountMatchedMsg)

```
npm package: @opzlab/template-scaffolding
Description: Library used to clone repositories and replace templated tags with input data
Latest version: 2.0.0

# Template Scaffolding 
A solution that allows you to clone any url that holds a zip under it and do basic template manipulations like replace values defined between two placeholders.

## Example
This library accepts the following object:

```TS
export interface TemplateScaffoldingOptions {
  /**
   * Any remote url is acceptable it only require a
   * zipped file to be downloaded.
   */
  remoteUrl: string;

  /**
   * This option allows to use a sub folder from cloned 
   * repository instead of directly the repository root 
   * folder. Define the path from inside the repo.
   * 
   * If this value is not defined the full repo will be used.
   */
  subFolder?: string;

  /**
   * How to store data locally
   */
  localOptions?: LocalOptions;

  /**
   * How to replace placeholders
   */
  replace?: ReplaceOptions;
}

export interface LocalOptions {
  /**
   * Path where data will be stored. THis path can be 
   * both relative or absolute, if the path is not 
   * defined the data will be stored in '.' directory.
   */
  folderUrl?: string;
}

export interface ReplaceOptions {
  /**
   * If property is not defined "{{" will be assigned
   */
  prefix?: string;

  /**
   * If property is not defined "}}" will be assigned
   */
  suffix?: string;

  /**
   * Data to replace. Normally this should look something like;
   * {
   *      "key": "value",
   *      "key": "value",
   *      ...
   * }
   */
  entries: object;
}
```
npm package: @opzlab/utils
Description: ### Format
Author: Terra
Latest version: 1.1.0

## Usage

### Format

```ts
import { readAmount, readDenom, readPercent, toAmount } from "@terra.kitchen/utils"

readAmount("1234567890") // "1234.56789"
readAmount("1234567890", { decimals: 0 }) // "1234567890"
readAmount("1234567890", { fixed: 6 }) // "1234.567890"
readAmount("1234567890", { comma: true }) // "1,234.56789"
readAmount("1234567890", { integer: true }) // "1234"
readAmount("1234567890", { prefix: true }) // "1.23K"

toAmount("1234.56789") // "1234567890"
toAmount("1234", { decimals: 0 }) // "1234"

readDenom("uluna") // "Luna"
readDenom("uusd") // "UST"

readPercent("1.23") // "123.00%"
readPercent("1.23", { fixed: 3 }) // "123.000%"
```

### Is

```ts
import { isDenom, isDenomTerra } from "@terra.kitchen/utils"

isDenomTerra("uusd") // true
isDenomTerra("uluna") // false

isDenom("uusd") // true
isDenom("uluna") // true
```

### Text

```ts
import { truncate } from "@terra.kitchen/utils"

truncate("terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v") // "terra1...20k38v"
truncate("terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v", [6, 3]) // "terra1...38v"
```
npm package: @or-change/duck-datahub
Description: In duck to use datahub can get a more easier coding experience in ORM like realms.
Author: ChaosLee
Latest version: 0.2.1

Datahub is an early project. It comes to be a data middle layer solution or data-typed micro service framework. In duck to use datahub can get a more easier coding experience in ORM like realms. Developer can ignore something about data persistence for focus on product features when developing. In practice, the cost of development can be reduced so much.

# Usage


Recommanded practice,
```js
const Duck = require('@or-change/duck');

// Can be from other files.
function Account(adapter, injection, context) {
  return {
    schemas: {
      type: 'object',
      properties: {
        id: { type: 'string' },
        name: { type: 'string' },
        email: { type: 'string' },
      }
    },
    methods: {
      query(accountId) {
        return adaptor.getAccountById(accountId);
      },
      ...
    }
  };
}

Duck({
  id: 'com.oc.duck.test',
  components: [
    Duck.Datahub([
      {
        id: 'com.foo.bar.baz',
        models: {
          Account
        }
      }
    ])
  ],
  installed({ Datahub, injection }) {
    // Getting a datahub instance with an adapter object.
    // Put it on injection for using in anywhere.
    injection.Model = Datahub('com.foo.bar.baz', { foo: 'bar' }).model;
  }
}, ({ Model }) => {
  // Using `Model` like this type in somewhere can accessing injection.
  const account = Model.Account.query('1');
  // => { id: 1, name: '...', email: '...' }
});
```
# API Reference

## Options
## Dependence
## Instant
## About adapter