Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phette23/volume-string-parser
parser for periodical volume/issue strings
https://github.com/phette23/volume-string-parser
Last synced: 27 days ago
JSON representation
parser for periodical volume/issue strings
- Host: GitHub
- URL: https://github.com/phette23/volume-string-parser
- Owner: phette23
- Created: 2016-09-28T04:46:37.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T13:58:56.000Z (about 1 year ago)
- Last Synced: 2024-09-19T15:09:05.117Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 729 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# volume-string-parser
![npm badge](https://img.shields.io/npm/v/volume-string-parse)
Turn serials issue/volume strings like 'v.1 no.3 Aut 1979' into meaningful data that could be used for sorting or other nefarious deeds.
```js
// node example
const parse = require('volume-string-parse')
const string = 'v.1 no.3 Aut 1979'
const data = parse(string)
console.log(data)
// data is
// { issue: '3',
// original_string: 'v.1 no.3 Aut 1979',
// volume: '1',
// year: '1979' }
```Ultimately, my goal is to have the module work in the browser.
# notes
Doesn't parse season/month information right now (e.g. "Aut" in example above). That seems really hairy, plus not necessary in many cases (redundant with issue number), but may be added eventually.
Returns `null` if a data field isn't present in the original string or wasn't parsed.
# license
[GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)