Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-props

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-props

Convert Java .properties to JSON

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-70.77%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-props

JavaScript Style Guide npm version Build Status Build status Dependency Status

A Gulp plugin to convert Java .properties to JSON

Install

npm install --save-dev gulp-props

Usage

const props = require('gulp-props');

// Generate a .js file with default namespace (config)
gulp.src('./src/*.properties')
  .pipe(props())
  .pipe(gulp.dest('./dist/'))

// Generate a .json file indented with 2 spaces
gulp.src('./src/*.properties')
  .pipe(props({ namespace: '', space: 2 }))
  .pipe(gulp.dest('./dist/'))

// Generate a .js file with a custom namespace (state)
gulp.src('./src/*.properties')
  .pipe(props({ namespace: 'state' }))
  .pipe(gulp.dest('./dist/'))

API

props([options])

options.namespace

Type: String

Default: config

The namespace to use when defining properties. Javascript reserved words cannot be used here. Invalid identifiers will be adjusted to be valid, and a warning will be printed in the console.

Note: To force a JSON output set this option to an empty string.

options.space

Type: Number or String

Default: null

Control spacing in the resulting output. It has the same usage as for JSON.stringify

The option is used only when namespace option is an empty string.

options.replacer

Type: Function or Array

Default: null

Further transform the resulting output. It has the same usage as for JSON.stringify

The option is used only when namespace option is an empty string.

options.appendExt

Type: Boolean

Default: false

Append the extension (.js or .json) instead of replacing it.

Useful if the property file doesn't have an extension.

License

MIT © Cristian Trifan

Keywords

FAQs

Package last updated on 22 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc