1.12.0 • Published 7 years ago

gulp-typescript-cs-poco v1.12.0

Weekly downloads
32
License
MIT
Repository
github
Last release
7 years ago

gulp-typescript-cs-poco

Overview

See https://github.com/ffMathy/typescript-cs-poco for actual implementation. This is just a wrapper.

Gulp-typescript-cs-poco is a Gulp plugin that translates basic C# POCO classes like this:

public class MyPoco
{
	public string Name { get; set; }
	public int Id { get; set; }
	public long Value { get; set; }
	public bool IsValid { get; set; }
	public SomeOtherPoco RelatedObject { get; set; }
}

Into this Typescript file:

interface MyPoco {
	Name: string;
	Id: number;
	Value: number;
	IsValid: boolean;
	RelatedObject: SomeOtherPoco;
}

Installation

Install with NPM:

npm install --save-dev gulp-typescript-cs-poco

Use

var pocoGen = require('gulp-typescript-cs-poco');

gulp.task('poco', function () {
  return gulp.src('Models/*.cs')
              .pipe(pocoGen())
              .pipe(gulp.dest('Scripts/myPocoTsFolder'));
})

This will create a single .ts file for every .cs file it finds. You can combine this with tools like gulp-concat to turn this into one file if desired.

Options

For a full list of options available, see: https://github.com/ffMathy/typescript-cs-poco

Options can be passed into the function to alter behavior. You can pass in only the options you need, or none at all for default behavior.

var pocoGen = require('gulp-typescript-cs-poco');

gulp.task('poco', function () {
  return gulp.src('Models/*.cs')
              .pipe(pocoGen({
                //options go here
	      }))
              .pipe(gulp.dest('Scripts/myPocoTsFolder'));
})

Or:

var pocoGen = require('gulp-typescript-cs-poco');

gulp.task('poco', function () {
  var pocoGenOptions = {
     //options go here
  };

  return gulp.src('Models/*.cs')
              .pipe(pocoGen(pocoGenOptions))
              .pipe(gulp.dest('Scripts/myPocoTsFolder'));
})
1.12.0

7 years ago

1.11.0

8 years ago

1.10.1

8 years ago

1.10.0

8 years ago

1.9.1

8 years ago

1.9.0

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.3

8 years ago

1.7.2

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.8

8 years ago

1.3.7

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago