js-stringify

WebJar for js-stringify

License

License

MIT
Categories

Categories

JavaScript Languages
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

js-stringify
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

js-stringify
WebJar for js-stringify
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/pugjs/js-stringify

Download js-stringify

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/js-stringify/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>js-stringify</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/js-stringify/
implementation 'org.webjars.npm:js-stringify:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/js-stringify/
implementation ("org.webjars.npm:js-stringify:1.0.2")
'org.webjars.npm:js-stringify:jar:1.0.2'
<dependency org="org.webjars.npm" name="js-stringify" rev="1.0.2">
  <artifact name="js-stringify" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='js-stringify', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "js-stringify" % "1.0.2"
[org.webjars.npm/js-stringify "1.0.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

js-stringify

Stringify an object so it can be safely inlined in JavaScript code

Build Status Dependency Status NPM version

Installation

npm install js-stringify

Usage

var assert = require('assert');
var stringify = require('js-stringify');

assert(stringify('foo') === '"foo"');
assert(stringify('foo\u2028bar\u2029baz') === '"foo\\u2028bar\\u2029baz"');
assert(stringify(new Date('2014-12-19T03:42:00.000Z')) === 'new Date("2014-12-19T03:42:00.000Z")');
assert(stringify({foo: 'bar'}) === '{"foo":"bar"}');
assert(stringify(undefined) === 'undefined');
assert(stringify(null) === 'null');
assert(
  stringify({val: "</script><script>alert('bad actor')</script>"}) ===
  '{"val":"\\u003C\\u002Fscript\\u003E\\u003Cscript\\u003Ealert(\'bad actor\')\\u003C\\u002Fscript\\u003E"}'
);

License

MIT

org.webjars.npm

Pug

Versions

Version
1.0.2