npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mfgames-culture-cli

v2.0.2

Published

A library for handling arbitrary cultures and calendars for fantasy and sci-fi.

Downloads

11

Readme

MfGames Culture (CLI)

Provides a command line interface (CLI) for MfGames Culture.

License

MIT

Parsing

The following are examples with en_US in the LANGUAGE environment.

$ mfgames-culture parse 7/14/2017
{"julian":2457948.5,"type":"instant","year":2017,"century":20,"millenniumCentury":0,"decade":201,"centuryDecade":1,"centuryYear":17,"decadeYear":7,"millennium":2,"yearDay":194,"yearMonth":6,"monthDay":13,"hour24":0,"meridiem":0,"hour12":0,"hourMinute":0,"minuteSecond":0}
$
$ mfgames-culture parse 7/14/2017 --indent 2
{
  "julian": 2457948.5,
  "type": "instant",
  "year": 2017,
  "century": 20,
  "millenniumCentury": 0,
  "decade": 201,
  "centuryDecade": 1,
  "centuryYear": 17,
  "decadeYear": 7,
  "millennium": 2,
  "yearDay": 194,
  "yearMonth": 6,
  "monthDay": 13,
  "hour24": 0,
  "meridiem": 0,
  "hour12": 0,
  "hourMinute": 0,
  "minuteSecond": 0
}
$
$ mfgames-culture parse 7/14/2017 --no-json --yaml
julian: 2457948.5
type: instant
year: 2017
century: 20
millenniumCentury: 0
decade: 201
centuryDecade: 1
centuryYear: 17
decadeYear: 7
millennium: 2
yearDay: 194
yearMonth: 6
monthDay: 13
hour24: 0
meridiem: 0
hour12: 0
hourMinute: 0
minuteSecond: 0
$

Options

--culture

string

Default: the process's culture

The culture key to use from inside the data file. For example, en-US. Both underscore and dashes are tested.

--data

string

Default: the built-in mfgames-culture-data source.

If this is given, then the culture files will be looked from the given directory instead of using mfgames-culture-data.

--format

string

Default: use the library's heuristics for identifying format

If provided, then the format of the input will be compared only against the given format instead of testing against all valid ones.

--indent

number|'t'

Default: 0

If this provided, then it will be used to control how much indention is used for formatting JSON or YAML. If t is provided, then JSON will be formatted with tabs.

--json, --no-json

boolean

Default: true

If true, then JSON output will be generated.

--type

'instant'|'period'

Default: instant

This will determine if the input is treated as an instant or a period.

--yaml, --no-yaml

boolean

Default: false

If this is true (--yaml), then YAML output will be produced. If --no-json isn't used, then JSON will also be printed to the output.

Formatting

The following are examples with en_US in the LANGUAGE environment.

$ mfgames-culture format 7/14/2017
7/14/2017 0:00 AM
0:00 AM
7/14/2017
7/14/2017 0:00 AM
07/14/2017
07/14/2017 0:00:00 AM
Jul 14, 17
7/14/2017
7/14/2017 0:00 AM
0:00 AM
2017-07-14
2017-07-14 00:00:00
$
$ mfgames-culture format 7/14/2017 --output-format 'YYYY-MM-DD'
2017-07-14
$
$ mfgames-culture format 7/14/2017 --output-style markdown-table
| format                | results               |
| --------------------- | --------------------- |
| default               | 7/14/2017 0:00 AM     |
| h:mm tt               | 0:00 AM               |
| M/D/YYYY              | 7/14/2017             |
| M/D/YYYY h:mm tt      | 7/14/2017 0:00 AM     |
| MM/DD/YYYY            | 07/14/2017            |
| MM/DD/YYYY h:mm:ss tt | 07/14/2017 0:00:00 AM |
| MMM DD, YY            | Jul 14, 17            |
| shortDate             | 7/14/2017             |
| shortDateTime         | 7/14/2017 0:00 AM     |
| shortTime             | 0:00 AM               |
| YYYY-MM-DD            | 2017-07-14            |
| YYYY-MM-DD HH:mm:ss   | 2017-07-14 00:00:00   |
$

Options

--culture

string

Default: the process's culture

The culture key to use from inside the data file. For example, en-US. Both underscore and dashes are tested.

--data

string

Default: the built-in mfgames-culture-data source.

If this is given, then the culture files will be looked from the given directory instead of using mfgames-culture-data.

--input-format

string

Default: use the library's heuristics for identifying format

If provided, then the format of the input will be compared only against the given format instead of testing against all valid ones.

--output-format

string

Default: show all formats

If provided, then the results will only be formatted with the given format, otherwise a table with all the formats will be printed.

--output-style

'bare'|'markdown-table'

Default: bare

Determines how the results are formatted and displayed. bare just lists the formatted results, one on each line. markdown-table shows a Markdown table with the format id in the first column and the formatted results in the other.

--type

'instant'|'period'

Default: instant

This will determine if the input is treated as an instant or a period.