Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('example:serve', () => {
http.createServer(ecstatic({
root: './example'
})).listen(4242);
const args = nopt({
open: Boolean
}, {
o: ['--open']
});
if (args.open) {
const url = 'http://localhost:4242';
gutil.log(gutil.colors.green('Opening', url));
opn(url, {
app: 'google chrome',
wait: false
});
}
});
import nopt from 'nopt'
import path from 'path'
const opts = {
outputDir: path,
port: Number,
clean: Boolean,
}
const shortOpts = {
o: ['--outputDir'],
p: ['--port'],
c: ['--clean'],
}
const output = nopt(opts, shortOpts, process.argv, 2)
output.outputDir = (output.outputDir === undefined) ? './output' : output.outputDir
output.port = (output.port === undefined) ? '9001' : output.port
export default output
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as path from "path";
import * as fs from "fs";
import * as hogan from "hogan.js";
import nopt from "nopt";
import * as mkderp from "mkdirp";
const options = nopt(
{
namespace: String,
outputdir: path,
variable: String,
wrapper: String,
version: true,
help: true
},
{
n: ["--namespace"],
o: ["--outputdir"],
vn: ["--variable"],
w: ["--wrapper"],
h: ["--help"],
v: ["--version"]
}