https://github.com/locize/resx
resx2js and js2resx converter resx resource utils
https://github.com/locize/resx
js json resources resx resxconverter translation
Last synced: 11 months ago
JSON representation
resx2js and js2resx converter resx resource utils
- Host: GitHub
- URL: https://github.com/locize/resx
- Owner: locize
- Created: 2017-10-06T22:03:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-21T09:40:11.000Z (about 3 years ago)
- Last Synced: 2025-06-29T15:02:19.012Z (11 months ago)
- Topics: js, json, resources, resx, resxconverter, translation
- Language: JavaScript
- Size: 468 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[](https://travis-ci.org/locize/resx) [](https://npmjs.org/package/resx)
## Download
The source is available for download from
[GitHub](https://github.com/locize/resx/archive/master.zip).
Alternatively, you can install using npm:
```sh
npm install --save resx
```
You can then `import` or `require()` resx as normal:
```js
import resx from 'resx'
// or
const resx = require('resx')
resx.resx2js(xml, (err, res) => {})
```
Or you can direclty `import` or `require()` its functions:
```js
import resx2js from 'resx/resx2js'
// or
const resx2js = require('resx/cjs/resx2js')
```
## Usage
```js
const xml = `
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Hello
An application to manipulate and process resx documents
resx Data Manager
`
const js = {
"key1": "Hello",
"key2": "An application to manipulate and process resx documents",
"key.nested": "resx Data Manager"
}
import resx2js from 'resx/resx2js'
resx2js(xml, (err, res) => {
// res is like js
})
import js2resx from 'resx/js2resx'
js2resx(js, (err, res) => {
// res is like xml
})
```
Omitting the callback returns a promise
```js
const resJs = await resx2js(xml)
const resXml = await js2resx(js)
// or
resx2js(xml).then((res) => {})
js2resx(js).then((res) => {})
```