npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jsonfromresx

v1.0.1

Published

Convert resource files (.resx) into JavaScript objects.

Downloads

2,145

Readme

JSON From Resx

JSON From Resx is a node module that converts resource files (.resx) into JavaScript objects.

From there, it's easy to save out as a JSON file for use on front-end projects.

Why does it exist?

When I converted an asp.net MVC website into a cordova application for Android/iOS, server side rendering of HTML was no longer possible.

The easiest thing to do was convert the resource files into JSON and bundle them with the app.

There weren't any up-to-date modules for this purpose at the time, so I created this module to meet that need.

Installation

This module is only designed to work as a node module.

The easiest way to install it is with:

npm install jsonfromresx --save-dev

Usage

First, require the module in your node project:

var jsonfromresx = require('jsonfromresx');

Then you can call convert to generate JavaScript objects from resource files.

convert(baseFilename, cultureFilename, options, callback)

baseFilename

Type: string
Required: true

cultureFilename

Type: string Required: false

If the cultureFilename parameter is defined, it merges the file with the baseFilename the same way that asp.net does. So if a key exists in both the base and culture resource file, the culture resource file version takes precedence.

options

Type: Object Required: false

Currently, there are no special options to be specified, and null or {} can be passed.

callback

Type: Function Required: true

convert is async, so once it's finished it will call the callback function with the resources object as the first parameter.

Example usage

jsonfromresx.convert(
  'fixtures/resources.resx',
  'fixtures/resources.zh-tw.resx',
  {},
  function (result) {
    console.log(result);
  }
);

Tests

Tests can be run with either npm test, nodeunit tests/ or grunt nodeunit.

Any contributions must ensure that all tests are passing and that you've added new tests for the new features.

During development, you can run grunt watch to have jshint and nodeunit run everytime you update the source code.

Reporting a bug

To report a bug simply create a new GitHub Issue and describe your problem or suggestion. All kinds of feedback are welcome, including but not limited to:

  • When jsonfromresx doesn't work as expected
  • When you simply want a new option or feature

License

jsonfromresx is released under the MIT license.

Development

jsonfromresx is currently maintained by Luke Howard.

Thank you!

I hope jsonfromresx serves its purpose for you, and I really appreciate all kinds of feedback and contributions!