reticker
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.1 • Public • Published

reticker

npm npm npm GitHub Workflow Status

A Python-ported stock tickers extractor using Regular Expressions.

Installation

npm install reticker
# -- or
yarn add reticker

Usage

import TickerExtractor from "reticker"

const tickerExtractor = new TickerExtractor();

const tickers = await tickerExtractor.extract("Comparing FNGU vs $WEBL vs SOXL- who wins? And what about $cldl vs $Skyu? IMHO, SOXL is king!\nBTW, will the $w+$Z pair still grow?");
# ['FNGU', 'WEBL', 'SOXL', 'CLDL', 'SKYU', 'W', 'Z']

const tickers = await tickerExtractor.extract("Which of BTC-USD, $ETH-USD and $ada-usd is best?\nWhat about $Brk.a and $Brk.B? Compare futures MGC=F and SIL=F.");
# ['BTC-USD', 'ETH-USD', 'ADA-USD', 'BRK.A', 'BRK.B', 'MGC=F', 'SIL=F']

Options

new TickerExtractor(deduplicate = true, options: TickerMatchConfig)

// deduplicate - Removes duplicate tickers from result

# TickerMatchConfig
prefixedUppercase?: boolean = true;
unprefixedUppercase?: boolean = true;
prefixedLowercase?: boolean = true;
prefixedTitlecase?: boolean = true;
separators?: string | undefined | null = ".-=";

TODO

  • Match ^STI
  • Match 9988.hk

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Credits

reticker

Readme

Keywords

none

Package Sidebar

Install

npm i reticker

Weekly Downloads

18

Version

0.0.1-alpha.1

License

MIT

Unpacked Size

10.9 kB

Total Files

10

Last publish

Collaborators

  • shaunlwm