Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bukinoshita/has-currency-code
Check if given string has currency code
https://github.com/bukinoshita/has-currency-code
checker code currencies currency javascript money nodejs
Last synced: 14 days ago
JSON representation
Check if given string has currency code
- Host: GitHub
- URL: https://github.com/bukinoshita/has-currency-code
- Owner: bukinoshita
- License: mit
- Created: 2017-07-04T15:08:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T23:23:01.000Z (about 2 years ago)
- Last Synced: 2024-10-27T15:52:39.328Z (2 months ago)
- Topics: checker, code, currencies, currency, javascript, money, nodejs
- Language: JavaScript
- Homepage:
- Size: 415 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# has-currency-code [![Build Status](https://travis-ci.org/bukinoshita/has-currency-code.svg?branch=master)](https://travis-ci.org/bukinoshita/has-currency-code) [![codecov](https://codecov.io/gh/bukinoshita/has-currency-code/branch/master/graph/badge.svg)](https://codecov.io/gh/bukinoshita/has-currency-code)
> Check if given string has currency code
## Install
```
$ yarn add has-currency-code
```## Usage
```js
const hasCurrencyCode = require('has-currency-code')hasCurrencyCode('I have USD300') // true
hasCurrencyCode('I do not have money') // false
```## API
### hasCurrencyCode(input, [options])
returns a `boolean` or `object`.
#### input
Type: `string`
Required#### options
Type: `object`
##### toObject
Type: `boolean`
Default: `false`If set to `true` it will return an `object`.
## Related
- [transform-currency](https://github.com/bukinoshita/transform-currency) — Transform currency code to symbol
- [currenci](https://github.com/bukinoshita/currenci) — List of currencies and get random currency
- [find-currency-code](https://github.com/bukinoshita/find-currency-code) — Find currency code from given string## License
MIT © [Bu Kinoshita](https://bukinoshita.io)