New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dot-properties

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-properties - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0

lib/ast.js

17

package.json
{
"name": "dot-properties",
"version": "0.4.0",
"main": "index.js",
"version": "1.0.0",
"license": "MIT",

@@ -16,5 +15,5 @@ "author": "Eemeli Aro <eemeli@gmail.com>",

],
"main": "./lib/index.js",
"files": [
"*.js",
"index.d.ts"
"lib/"
],

@@ -32,12 +31,14 @@ "scripts": {

"prettier": {
"arrowParens": "avoid",
"semi": false,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^25.1.0",
"prettier": "^1.19.1"
"jest": "^25.3.0",
"prettier": "^2.0.4"
}
}

@@ -6,2 +6,3 @@ # dot-properties <a href="https://www.npmjs.com/package/dot-properties"><img align="right" src="https://badge.fury.io/js/dot-properties.svg" title="npm package" /></a><a href="https://codecov.io/gh/eemeli/dot-properties"><img align="right" src="https://codecov.io/gh/eemeli/dot-properties/branch/master/graph/badge.svg" title="Code coverage" /></a><a href="https://travis-ci.org/eemeli/dot-properties"><img align="right" src="https://travis-ci.org/eemeli/dot-properties.svg?branch=master" title="Build status" /></a>

To install:
```

@@ -15,3 +16,4 @@ npm install dot-properties

### `parse(src[, path])`
### `parse(str: string | Line[] | Node[], path?: boolean | string): object`
Parses an input string read from a .properties file into a JavaScript Object

@@ -21,3 +23,4 @@

### `parseLines(src)`
### `parseLines(str: string, ast?: false): Line[]`
Splits the input string into an array of logical lines; useful if you want to preserve order, comments and/or empty lines while processing. Used internally by `parse()`.

@@ -27,8 +30,15 @@

### `stringify(input[, options])`
Stringifies a hierarchical object or an array of lines to `.properties` format
### `parseLines(str: string, ast: true): Node[]`
Splits the input string into an array of AST nodes; see [the source](./lib/ast.js) for more details.
### `stringify(input: object, options?: StringifyOptions): string`
Stringifies a hierarchical object or an array of lines or nodes to `.properties` format
If `input` is a hierarchical object, keys will consist of the path parts joined by `.` characters. With array input, string values represent blank or comment lines and string arrays are `[key, value]` pairs. Control characters and `\` will be appropriately escaped. If the `latin1` option is not set to false, all non-Latin-1 characters will also be `\u` escaped. Non-empty string lines represent comments, and will have any existing `#` or `!` prefix replaced by the `commentPrefix`.
Output styling is controlled by the second (optional) `options` parameter; by default a spaced `=` separates the key from the value, `\n` is the newline separator, lines are folded at 80 characters (at most, splitting at nice places), with subsequent lines indented by four spaces, and comment lines are prefixed with a `#`. `''` as a key value is considered the default, and set as the value of a key corresponding to its parent object's path:
<!-- prettier-ignore -->
```js

@@ -50,2 +60,3 @@ const defaultOptions = {

### `example.properties`
```

@@ -77,5 +88,7 @@ # You are reading the ".properties" entry.

```
_Source: [Wikipedia](https://en.wikipedia.org/wiki/.properties)_
### `example.js`
```js

@@ -82,0 +95,0 @@ const fs = require('fs')

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