https://github.com/afrontend/ary2json
하나의 파일로 언어별 JSON 파일 생성하기
https://github.com/afrontend/ary2json
Last synced: 12 months ago
JSON representation
하나의 파일로 언어별 JSON 파일 생성하기
- Host: GitHub
- URL: https://github.com/afrontend/ary2json
- Owner: afrontend
- License: mit
- Created: 2020-06-25T13:51:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T12:27:03.000Z (almost 2 years ago)
- Last Synced: 2025-05-30T13:07:22.160Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://agvim.wordpress.com/2020/05/10/use-csv-file-for-i18n/
- Size: 144 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://opensource.org/licenses/mit-license.php)
# ary2json
* Convert text array to JSON
* Convert JSON to text array
## Install
```sh
npm install ary2json
```
## Usage (text array to JSON)
```javascript
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)
```javascript
const ko = {
path1: {
path2: {
path3: '로그인'
}
}
}
objToTextPathsAry(ko).forEach(function (s) {
console.log(s)
})
로그인; path1; path2; path3
```
## License
MIT © [Bob Hwang](https://afrontend.github.io)