gulp-archieml
Advanced tools
+21
| # Changelog | ||
| All notable changes to this project will be documented in this file. | ||
| The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). | ||
| ## [1.1.0] - 2018-08-07 | ||
| ### Changed | ||
| - Bumped `archieml` to the latest version, 0.4.2 | ||
| - ES2015 syntax, which means Node 6.4.x is now required | ||
| ### Fixed | ||
| - Switched to CircleCI 2.0 test config, due to pending 1.0 deprecation | ||
| - Drops deprecated `gulp-util` module | ||
| ## [1.0.0] - 2016-03-18 | ||
| Initial release | ||
| [Unreleased]: https://github.com/DallasMorningNews/generator-dmninteractives/compare/v1.1.0...HEAD | ||
| [1.1.0]: https://github.com/DallasMorningNews/generator-dmninteractives/compare/v1.0.0...v1.1.0 | ||
| [1.0.0]: https://github.com/DallasMorningNews/gulp-archieml/tree/v1.0.0 |
+25
-25
@@ -1,30 +0,30 @@ | ||
| 'use strict'; | ||
| const archieml = require('archieml'); | ||
| const PluginError = require('plugin-error'); | ||
| const replaceExt = require('replace-ext'); | ||
| const through = require('through2'); | ||
| var gutil = require('gulp-util'), | ||
| through = require('through2'), | ||
| archieml = require('archieml'); | ||
| module.exports = function () { | ||
| return through.obj(function(file, enc, cb) { | ||
| if (file.isNull()) { | ||
| cb(null, file); | ||
| return; | ||
| } | ||
| module.exports = () => through.obj(function archieToJson(file, enc, cb) { | ||
| if (file.isNull()) { | ||
| cb(null, file); | ||
| return; | ||
| } | ||
| if (file.isStream()) { | ||
| cb(new gutil.PluginError('gulp-archieml', 'Streaming not supported')); | ||
| return; | ||
| } | ||
| if (file.isStream()) { | ||
| cb(new PluginError('gulp-archieml', 'Streaming not supported')); | ||
| return; | ||
| } | ||
| try { | ||
| var parsed = archieml.load(file.contents.toString()); | ||
| file.contents = new Buffer(JSON.stringify(parsed)); | ||
| file.path = gutil.replaceExtension(file.path, '.json'); | ||
| this.push(file); | ||
| } catch (err) { | ||
| this.emit('error', new gutil.PluginError('gulp-archieml', err)); | ||
| } | ||
| try { | ||
| const parsed = archieml.load(file.contents.toString()); | ||
| const jsonFile = Object.assign(file, { | ||
| contents: Buffer.from(JSON.stringify(parsed)), | ||
| path: replaceExt(file.path, '.json'), | ||
| }); | ||
| this.push(jsonFile); | ||
| } catch (err) { | ||
| this.emit('error', new PluginError('gulp-archieml', err)); | ||
| } | ||
| cb(); | ||
| }); | ||
| }; | ||
| cb(); | ||
| }); |
+16
-8
| { | ||
| "name": "gulp-archieml", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "A Gulp plugin for parsing ArchieML files.", | ||
@@ -12,6 +12,7 @@ "license": "MIT", | ||
| "engines": { | ||
| "node": ">=0.10.0" | ||
| "node": ">=6.4.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "./node_modules/jshint/bin/jshint index.js && ./node_modules/mocha/bin/mocha test" | ||
| "lint": "eslint index.js", | ||
| "test": "istanbul cover _mocha test && istanbul report html" | ||
| }, | ||
@@ -25,12 +26,19 @@ "files": [ | ||
| "dependencies": { | ||
| "archieml": "^0.3.1", | ||
| "gulp-util": "^3.0.1", | ||
| "archieml": "^0.4.2", | ||
| "plugin-error": "^1.0.1", | ||
| "replace-ext": "^1.0.0", | ||
| "through2": "^0.6.3" | ||
| }, | ||
| "devDependencies": { | ||
| "assert": "^1.3.0", | ||
| "jshint": "^2.9.1", | ||
| "mocha": "^2.4.5", | ||
| "assert": "^1.4.1", | ||
| "eslint": "^4.19.1", | ||
| "eslint-config-airbnb": "^17.0.0", | ||
| "eslint-plugin-import": "^2.13.0", | ||
| "eslint-plugin-jsx-a11y": "^6.1.1", | ||
| "eslint-plugin-react": "^7.10.0", | ||
| "istanbul": "^0.4.5", | ||
| "mocha": "^5.2.0", | ||
| "mocha-junit-reporter": "^1.17.0", | ||
| "vinyl-fs": "^2.4.2" | ||
| } | ||
| } |
+12
-9
| # gulp-archieml | ||
|  [](https://github.com/DallasMorningNews/gulp-archieml) [](https://github.com/DallasMorningNews/gulp-archieml/blob/master/LICENSE) | ||
| [](https://circleci.com/gh/DallasMorningNews/gulp-archieml) | ||
| A Gulp plugin for parsing Archie Markup Language (ArchieML) files into JSON using [archieml-js](https://github.com/newsdev/archieml-js). | ||
@@ -24,10 +23,8 @@ | ||
| ```js | ||
| var gulp = require('gulp'), | ||
| archieml = require('gulp-archieml'); | ||
| const gulp = require('gulp'); | ||
| const archieml = require('gulp-archieml'); | ||
| gulp.task('test', function() { | ||
| return gulp.src('./path/to/*.aml') | ||
| .pipe(archieml()) | ||
| .pipe(gulp.dest('./path/to/json/output/')); | ||
| }); | ||
| gulp.task('test', () => gulp.src('./path/to/*.aml') | ||
| .pipe(archieml()) | ||
| .pipe(gulp.dest('./path/to/json/output/'))); | ||
| ``` | ||
@@ -43,5 +40,11 @@ | ||
| Coverage is calculated using Istanbul and output to the _coverage_ folder: | ||
| ``` | ||
| $ open coverage/index.html | ||
| ``` | ||
| ## License | ||
| MIT ©2016 [The Dallas Morning News](https://github.com/DallasMorningNews) |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
5157
39.23%5
25%49
6.52%4
33.33%10
150%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated