2.0.2 • Published 6 years ago

gulp-resx-convert v2.0.2

Weekly downloads
190
License
MIT
Repository
github
Last release
6 years ago

gulp-resx-convert build package

A .resx file converter for gulp. Supports multiple output formats, including JSON, Typescript and C# constants class

Installation

Add this module as a development dependency:

npm install --save-dev gulp-resx-convert

Usage

This gulp plugin supports converting .resx files to multiple file types.

var resxConverter = require("gulp-resx-convert");

gulp.task("test", function () {

    gulp.src(["./Test/*.resx"]) //Pipe one or more files at a time
        .pipe(resxConverter.convert({
            //Include this for JSON
            json: {},
            //Include this for TypeScript
            typescript: {
                //Disables support for culture names in file name (ex: File.en-US.resx or File.en.resx).
                //Default: false
                culturesDisabled: false,
                //Sets the namespace to be used.
                //Default: Resx
                namespace:"Resx",
                //Enables converting to .ts files.
                //Default: false
                source: true,
                //Enables converting to .d.ts files
                //Default: false
                declaration: true
            },
			csharp: {
				//Sets the namespace to be used
				namespace: "Resx"
				//Output as properties or constants. Setting this to true will use properties
				properties: false;
				//Set this to true to create a partial class
				partial: false;
			}
        }))
        .pipe(gulp.dest("./Test/Output"));
});

Types from Resx

To specify the type to use in output instead of a string, use the Comment property in the .resx file to describe the type as in the followin example:

{"csharp":"int", "typescript":"number", "raw":true}

Setting the raw value to true means that the converter will output the value directly during assignment, without wrapping it in quotes. This should be used when the value is a number, boolean etc.

Notes

This plugin does not handle scenarios where file names contain spaces or invalid characters. Please use gulp-rename before converting the files.

Documentation

Additional documentation may be found in the Project Wiki

2.0.2

6 years ago

2.0.1

6 years ago

1.1.89

6 years ago

1.1.88

6 years ago

1.1.87

6 years ago

1.1.86

6 years ago

1.1.85

6 years ago

1.1.84

6 years ago

1.1.83

6 years ago

1.1.81

6 years ago

1.1.80

6 years ago

1.1.79

6 years ago

1.1.78

6 years ago

1.1.77

6 years ago

1.1.76

6 years ago

1.1.75

6 years ago

1.1.72

6 years ago

1.1.69

6 years ago

1.1.68

6 years ago

1.1.67

6 years ago

1.1.66

6 years ago

1.1.65

6 years ago

1.1.62

6 years ago

1.1.61

6 years ago

1.1.60

6 years ago

1.1.54

6 years ago

1.1.52

6 years ago

1.1.51

6 years ago