1.0.0 • Published 8 years ago
fsdk v1.0.0
fsdk
Managing your front-end sdk. Cuts source code by environment.
Install
npm install fsdk
Usage
var fsdk = require('fsdk');
fsdk.compile({
src: './sdk/**/*.*',
dest: './dist/',
env: 'user-part'
});
or using with gulp:
var gulp = require('gulp');
var fsdk = require('fsdk');
gulp.task('compileSDK', function () {
return gulp.src('sdk/*.*')
.pipe(fsdk.parseFile('user-part'))
.pipe(gulp.dest('dist/sdk'))
});
Example source file:
function User () {
}
User.prototype.get = function() {
};
User.prototype.update = function() {
};
// fsdk:start(admin-part)
User.prototype.delete = function(first_argument) {
};
// fsdk:end
Result:
function User () {
}
User.prototype.get = function() {
};
User.prototype.update = function() {
};
Supported comments
- JS:
// fsdk:start(env)
- CoffeeScript:
# fsdk:start(env)
API
fsdk.compile(options)
options
Type: object
All options is required
options.src
Type: string
or array
Glob or array of globs to read (node-glob syntax). More info
options.dest
Type: string
The path (output folder) to write files to. More info
options.env
Type: string
Source code environment
fsdk.parseFile(env)
Returns a stream
env
Type: string
Source code environment
License
1.0.0
8 years ago