# options-contract-name-parse

> parse names of options contracts

Latest version **0.0.11** (published 2023-05-29) · GPL license · 0 weekly downloads

## Install

```sh
npm install options-contract-name-parse
pnpm add options-contract-name-parse
yarn add options-contract-name-parse
bun add options-contract-name-parse
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2023-05-29 |
| First published | 2023-05-29 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | stonkpunk |
| Maintainers | stonkpunk |

## Links

- npm: https://www.npmjs.com/package/options-contract-name-parse
- Homepage: https://github.com/stonkpunk/my-npm-modules/tree/main/options-contract-name-parse
- npm.io page: https://npm.io/package/options-contract-name-parse

## Recent versions

- 0.0.11 (latest) — 2023-05-29
- 0.0.1 — 2023-05-29

## README

# options-contract-name-parse

parse names of options contracts like `QQQ230530C00292000` or `AAPL230526C00110000`

the expected format is 
`SYMBOL + YYMMDD + P|C + 8-digit-strike-price-in-thousandths-of-dollars`

does not work for options from before the year 2000.

experimental, use at your own risk.

## Installation

```sh
npm i options-contract-name-parse
```

## Usage 

```javascript
var parseName = require('options-contract-name-parse').parse;

var contractName = "QQQ230530C00292000";
var parsedContract = parseName(contractName);

console.log(parsedContract);

// {
//   symbol: 'QQQ',
//   expirationDateYYMMDD: '23/05/30',
//   expirationDateISO: '2023-05-30T16:00:00.000Z',
//   expirationDateUnixSeconds: 1685462400,
//   optionType: 'call',
//   strikePrice: 292
// }

var contractName2 = "AAPL230526C00110000";
var parsedContract2 = parseName(contractName2);

console.log(parsedContract2);

// {
//   symbol: 'AAPL',
//   expirationDateYYMMDD: '23/05/26',
//   expirationDateISO: '2023-05-26T16:00:00.000Z', //assumes 4PM EST
//   expirationDateUnixSeconds: 1685116800,
//   optionType: 'call',
//   strikePrice: 110
// }
```


[![stonks](https://i.imgur.com/UpDxbfe.png)](https://www.npmjs.com/~stonkpunk)

---
_Source: https://npm.io/package/options-contract-name-parse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
