Wondering what’s next for npm?Check out our public roadmap! »

    shared-preferences-builder

    0.0.4 • Public • Published

    shared-preferences-builder Build Status

    Android Shared Preferences builder

    Usage

    let builder = new SharedPrefsBuilder()
    builder.build([
      {'type': 'string', name: 'str', value: 'im a string'},
      {'type': 'int', name: 'number', value: 1},
      {'type': 'float', name: 'f', value: 1.3},
      {'type': 'set', name: 'set', value: ['ha', 'hb']},
      {'type': 'long', name: 'long', value: 1239812738},
      {'type': 'boolean', name: 'flag', value: true}
    ])
    console.log(builder.toString())
    /**
    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <map>
      <string name="str">im a string</string>
      <int name="number" value="1"/>
      <float name="f" value="1.3"/>
      <set name="set">
        <string>ha</string>
        <string>hb</string>
      </set>
      <long name="long" value="1239812738"/>
      <boolean name="flag" value="true"/>
    </map>
    **/
    builder.toFile('com.my.package.shared.prefs.xml')

    Install

    npm i shared-preferences-builder

    DownloadsWeekly Downloads

    85,077

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • avatar