electron-egg electron-egg
首页
  • v4.x
  • v3.x
  • v2.x
插件
  • v4.x
  • v3.x
demo
支持
知识点
案例
交流
  • GitHub (opens new window)
  • Gitee (opens new window)
首页
  • v4.x
  • v3.x
  • v2.x
插件
  • v4.x
  • v3.x
demo
支持
知识点
案例
交流
  • GitHub (opens new window)
  • Gitee (opens new window)
❤️成为赞助商
  • 教程

  • ee-bin

  • ee-core

    • addon

      • 插件模块
      • window
    • bin
    • config
    • const
    • const/channel
    • controller
    • core
    • cross
    • ee
    • electron
    • electron/app
    • electron/window
    • exception
    • httpclient
    • jobs
    • jobs/ChildJob
    • jobs/ChildPoolJob
    • loader
    • log
    • message
    • message/childMessage
    • ps
    • services
    • socket
    • storage
    • storage/jsondb
    • storage/sqlite
    • tools
    • this-app

    • utils
    • utils/helper
    • utils/is
    • utils/json
      • utils/time
      • utils/ip
      • utils/get-port
      • oldUtils
    • ee-go

    目录

    utils/json

    ee-core:v2.0.3

    # 介绍

    工具库Json模块。

    # 使用方法

    const UtilsJson = require('ee-core/utils/json');
    

    # API列表

    # strictParse(str)

    • str [String] - 字符串

    字符串转对象

    # readSync(filepath)

    • filepath [String] - 文件的绝对路径

    同步读取一个json文件。

    # writeSync(filepath, str, options)

    • filepath [String] - json文件的绝对路径
    • str [String|Object] - 对象或字符串对象
    • options
      • space [Number] - 缩进,默认2

    同步写入一个对象或对象字符串到文件。

    # read(filepath)

    异步读取一个json文件。返还promise

    # write(filepath, str, options)

    • filepath [String] - json文件的绝对路径
    • str [String|Object] - 对象或字符串对象
    • options
      • space [Number] - 缩进,默认2

    异步写入一个对象或对象字符串到文件。

    上次更新: 2025/06/06, 07:21:49
    utils/is
    utils/time

    ← utils/is utils/time→

    Theme by Vdoing | Copyright © 2023-2025 哆啦好梦 | 京ICP备15041380号-2
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式
    ×