Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including resx-to-typescript with all npm packages installed. Try it out:

var resxToTypescript = require("resx-to-typescript")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

resx-to-typescript v1.0.15

Converts resx files to TypeScript models

node-resx-to-typescript

Source code for node module: resx-to-typescript

Node module for generating TypeScript (models) files based on resx files.

To use this node module at a reference to your project package.json dependencies.

{ "dependencies": { "resx-to-typescript": "1.0.15" } }

The script requires one parameter, the virtual path to the TypeScript file you want to add.

So, to use the module in for instance a gulp task:

var resxToTypeScript = require('resx-to-typescript');

resxToTypeScript.execute('exampleApp.resources', '/Resources', '/App/Resources');

where the parameters stand for:

'exampleApp.resources' -> TypeScript namespace for the resource models. '/Resources' -> Relative folder to scan for .resx files. '/App/Resources' -> Output directory for TypeScript files

Voilá, the TypeScript models for your resx files are added to your project and ready to use in typescript development/mvc bundling.

UPDATES:

2017-25-01 Removed runtime node deprecation warning. (v 1.0.15) 2016-08-19 Refactored code and added support for multi line resources. (v 1.0.12)

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free