2.3.9 • Published 1 year ago

android-string-resource v2.3.9

Weekly downloads
7,259
License
MIT
Repository
github
Last release
1 year ago

travis npm

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

npm install --save android-string-resource

You can then import or require() android-string-resource as normal:

import android from 'android-string-resource'
// or
const android = require('android-string-resource')

android.asr2js(xml, (err, res) => {})

Or you can direclty import or require() its functions:

import asr2js from 'android-string-resource/asr2js'
// or
const asr2js = require('android-string-resource/cjs/asr2js')

Usage

const xml = `<resources>
  <string name="key1">Hello</string>
  <string name="key2">An application to manipulate and process asr documents</string>
  <string name="key.nested">asr Data Manager</string>
</resources>`

const js = {
  "key1": "Hello",
  "key2": "An application to manipulate and process asr documents",
  "key.nested": "asr Data Manager"
}

const asr2js = require('android-string-resource/asr2js')
asr2js(xml, (err, res) => {
  // res is like js
})

const js2asr = require('android-string-resource/js2asr')
js2asr(js, (err, res) => {
  // res is like xml
})

Omitting the callback returns a promise

const resJs = await asr2js(xml)
const resXml = await js2asr(js)
// or
asr2js(xml).then((res) => {})
js2asr(js).then((res) => {})
2.3.9

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.4

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.0

4 years ago

2.3.1

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago