1.0.4 • Published 3 years ago

ary2json v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

MIT Licence

ary2json

  • Convert text array to JSON
  • Convert JSON to text array

Install

npm install ary2json

Usage (text array to JSON)

const { textPathsAryToObj, objToTextPathsAry, toJSONString } = require('ary2json')
const obj = textPathsAryToObj([[ '로그인', 'login', 'path1', 'path2', 'path3' ]], {
  numberOfLanguageColumn: 2
})
console.log(toJSONString(obj))
[
  {
    path1: {
      path2: {
        path3: '로그인'
      }
    }
  },
  {
    path1: {
      path2: {
        path3: 'login'
      }
    }
  }
]

Usage (JSON to text array)

const ko = {
    path1: {
      path2: {
        path3: '로그인'
      }
    }
  }

objToTextPathsAry(ko).forEach(function (s) {
  console.log(s)
})
로그인; path1; path2; path3

License

MIT © Bob Hwang

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago