GraphQL ISO Date 项目使用教程

GraphQL ISO Date 项目使用教程

graphql-iso-dateA set of RFC 3339 compliant date/time GraphQL scalar types.项目地址:https://gitcode.com/gh_mirrors/gr/graphql-iso-date

项目的目录结构及介绍

graphql-iso-date/
├── LICENSE
├── README.md
├── index.js
├── package.json
├── src/
│   ├── Date.js
│   ├── DateTime.js
│   └── Time.js
└── test/
    ├── Date.spec.js
    ├── DateTime.spec.js
    └── Time.spec.js
  • LICENSE: 项目许可证文件。
  • README.md: 项目说明文档。
  • index.js: 项目入口文件。
  • package.json: 项目依赖和配置文件。
  • src/: 包含项目的源代码文件。
    • Date.js: 处理日期的文件。
    • DateTime.js: 处理日期和时间的文件。
    • Time.js: 处理时间的文件。
  • test/: 包含项目的测试文件。
    • Date.spec.js: 日期测试文件。
    • DateTime.spec.js: 日期和时间测试文件。
    • Time.spec.js: 时间测试文件。

项目的启动文件介绍

项目的启动文件是 index.js,它负责初始化和导出项目的各个模块。以下是 index.js 的简要内容:

const { GraphQLScalarType } = require('graphql');
const { Kind } = require('graphql/language');
const { GraphQLError } = require('graphql');

const DateScalar = require('./src/Date');
const DateTimeScalar = require('./src/DateTime');
const TimeScalar = require('./src/Time');

module.exports = {
  Date: DateScalar,
  DateTime: DateTimeScalar,
  Time: TimeScalar,
};

该文件导入了 src 目录下的日期、日期时间和时间处理模块,并将它们导出供其他模块使用。

项目的配置文件介绍

项目的配置文件是 package.json,它包含了项目的基本信息、依赖项和其他配置。以下是 package.json 的简要内容:

{
  "name": "graphql-iso-date",
  "version": "1.2.2",
  "description": "A set of RFC 3339 compliant date/time scalar types to be used with GraphQL.js.",
  "main": "index.js",
  "scripts": {
    "test": "jest"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/excitement-engineer/graphql-iso-date.git"
  },
  "keywords": [
    "graphql",
    "date",
    "time",
    "datetime",
    "rfc3339",
    "scalar"
  ],
  "author": "excitement-engineer",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/excitement-engineer/graphql-iso-date/issues"
  },
  "homepage": "https://github.com/excitement-engineer/graphql-iso-date#readme",
  "dependencies": {
    "graphql": "^15.0.0"
  },
  "devDependencies": {
    "jest": "^26.0.1"
  }
}
  • name: 项目名称。
  • version: 项目版本。
  • description: 项目描述。
  • main: 项目入口文件。
  • scripts: 包含可执行的脚本命令,如 test
  • repository: 项目仓库信息。
  • keywords: 项目关键词。
  • author: 项目作者。
  • license: 项目许可证。
  • bugs: 项目问题追踪地址。
  • homepage: 项目主页。
  • dependencies: 项目依赖项。
  • devDependencies: 开发依赖项。

graphql-iso-dateA set of RFC 3339 compliant date/time GraphQL scalar types.项目地址:https://gitcode.com/gh_mirrors/gr/graphql-iso-date

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

伍盛普Silas

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值