0.0.6 • Published 3 years ago

@iuser/it v0.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

@iuser/it

i18n translate file

like NestedText , but tiny

安装

推荐用 @antfu/ni

ni -D @iuser/it

使用

→ test/index.coffee

#!/usr/bin/env coffee

> @iuser/it > dumps loads

txt = dumps {
  x : 'a'
  y :
    c : 'b'
    'a : 1': 2
    e : """Mosh
      (mobile shell)
      Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.

      Mosh is a replacement for interactive SSH terminals. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.

      Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, Chrome, and iOS."""
}

console.log txt

console.log '\n---\n'

o = loads txt
console.log o

console.log '\n---\n'

console.log txt == dumps (o)

输出

→ out.txt

x : a
y :
  c : b
  a : 1 |
    2
  e |
    Mosh
    (mobile shell)
    Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.

    Mosh is a replacement for interactive SSH terminals. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.

    Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, Chrome, and iOS.
  a :
    j : 2
    x :
      f : 5
      g : 6
f : 3


---

{
  x: 'a',
  y: {
    c: 'b',
    'a : 1': '2',
    e: 'Mosh\n' +
      '(mobile shell)\n' +
      'Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.\n' +
      '\n' +
      "Mosh is a replacement for interactive SSH terminals. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.\n" +
      '\n' +
      'Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, Chrome, and iOS.',
    a: { j: '2', x: [Object] }
  },
  f: '3'
}

---

true