1.0.4 • Published 2 years ago

@eslibs/serializer v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Serializer

js 数据序列化,方便数据交换,目前效率可能不高

Feature

Supported datatype

  • string
  • number
  • boolean
  • null
  • undefined
  • bigint
  • array
  • object
  • arraybuffer
  • blob
  • file
  • date
  • error
  • formdata
  • headers
  • map
  • regexp
  • request
  • response
  • set

Usage

via node

import { Serializer } from '@eslibs/serializer'

Serializer.stringify(Object)

Serializer.parse(String)

via browser

<script src="https://unpkg.com/@eslibs/serializer@latest/dist/eslibs.umd.js"></script>

<script>
ESLibs.Serializer.stringify(Object)
ESLibs.Serializer.parse(String)
</script>

via js module

<script type="importmap">
  {
    "imports": {
      "@eslibs/serializer": "https://unpkg.com/@eslibs/serializer@latest/dist/index.es.js"
    }
  }
</script>

<script type="module">
    import { Serializer } from '@eslibs/serializer'

    Serializer.stringify(Object)
    Serializer.parse(String)
</script>

License

MIT