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

@rdfjs/serializer-jsonld

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rdfjs/serializer-jsonld - npm Package Compare versions

Comparing version 1.2.3 to 2.0.0

.github/workflows/test.yaml

6

index.js

@@ -1,3 +0,3 @@

const SerializerStream = require('./lib/SerializerStream')
const Sink = require('@rdfjs/sink')
import Sink from '@rdfjs/sink'
import SerializerStream from './lib/SerializerStream.js'

@@ -10,2 +10,2 @@ class Serializer extends Sink {

module.exports = Serializer
export default Serializer

@@ -17,2 +17,2 @@ class ObjectEncoder {

module.exports = ObjectEncoder
export default ObjectEncoder

@@ -1,4 +0,4 @@

const Readable = require('readable-stream')
const ObjectEncoder = require('./ObjectEncoder')
const StringEncoder = require('./StringEncoder')
import { Readable } from 'readable-stream'
import ObjectEncoder from './ObjectEncoder.js'
import StringEncoder from './StringEncoder.js'

@@ -73,2 +73,2 @@ class SerializerStream extends Readable {

module.exports = SerializerStream
export default SerializerStream

@@ -25,2 +25,2 @@ class StringEncoder {

module.exports = StringEncoder
export default StringEncoder
{
"name": "@rdfjs/serializer-jsonld",
"version": "1.2.3",
"description": "JSON-LD serializer that implements the RDFJS Sink interface",
"version": "2.0.0",
"description": "JSON-LD serializer that implements the RDF/JS Sink interface",
"type": "module",
"main": "index.js",
"scripts": {
"test": "standard && mocha"
"test": "stricter-standard && c8 --reporter=lcov --reporter=text mocha"
},

@@ -26,12 +27,14 @@ "repository": {

"dependencies": {
"@rdfjs/namespace": "^1.1.0",
"@rdfjs/sink": "^1.0.3",
"readable-stream": "^3.6.0"
"@rdfjs/sink": "^2.0.0",
"readable-stream": "^4.2.0"
},
"devDependencies": {
"@rdfjs/data-model": "^1.2.0",
"get-stream": "^6.0.1",
"mocha": "^8.4.0",
"standard": "^16.0.3"
"@rdfjs/data-model": "^2.0.1",
"@rdfjs/namespace": "^2.0.0",
"assert": "^2.0.0",
"c8": "^7.12.0",
"mocha": "^10.0.0",
"stream-chunks": "^1.0.0",
"stricter-standard": "^0.2.0"
}
}
# @rdfjs/serializer-jsonld
[![Build Status](https://travis-ci.org/rdfjs/serializer-jsonld.svg?branch=master)](https://travis-ci.org/rdfjs/serializer-jsonld)
[![build status](https://img.shields.io/github/workflow/status/rdfjs-base/serializer-jsonld/Test)](https://github.com/rdfjs-base/serializer-jsonld/actions/workflows/test.yaml)
[![npm version](https://img.shields.io/npm/v/@rdfjs/serializer-jsonld.svg)](https://www.npmjs.com/package/@rdfjs/serializer-jsonld)
JSON-LD serializer that implements the [RDFJS Sink interface](http://rdf.js.org/).
JSON-LD serializer that implements the [RDF/JS Sink interface](http://rdf.js.org/).

@@ -12,3 +10,3 @@ ## Usage

The package exports the serializer as a class, so an instance must be created before it can be used.
The `.import` method, as defined in the [RDFJS specification](http://rdf.js.org/#sink-interface), must be called to do the actual serialization.
The `.import` method, as defined in the [RDF/JS specification](http://rdf.js.org/#sink-interface), must be called to do the actual serialization.
It expects a quad stream as argument.

@@ -32,5 +30,5 @@ The method will return a stream which emits the JSON-LD as a plain object or string.

```javascript
const rdf = require('@rdfjs/data-model')
const Readable = require('stream').Readable
const SerializerJsonld = require('@rdfjs/serializer-jsonld')
import rdf from '@rdfjs/data-model'
import { Readable } from 'readable-stream'
import SerializerJsonld from '@rdfjs/serializer-jsonld'

@@ -37,0 +35,0 @@ const serializerJsonld = new SerializerJsonld()

@@ -1,6 +0,9 @@

const namespace = require('@rdfjs/namespace')
import namespace from '@rdfjs/namespace'
module.exports = {
ex: namespace('http://example.org/'),
rdf: namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
const ex = namespace('http://example.org/')
const rdf = namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
export {
ex,
rdf
}

@@ -1,9 +0,10 @@

const { deepStrictEqual, throws } = require('assert')
const rdf = require('@rdfjs/data-model')
const sinkTest = require('@rdfjs/sink/test')
const getStream = require('get-stream')
const { describe, it } = require('mocha')
const Readable = require('readable-stream')
const ns = require('./support/namespaces')
const JsonLdSerializer = require('..')
import { deepStrictEqual, throws } from 'assert'
import rdf from '@rdfjs/data-model'
import sinkTest from '@rdfjs/sink/test/index.js'
import { describe, it } from 'mocha'
import { Readable } from 'readable-stream'
import chunks from 'stream-chunks/chunks.js'
import decode from 'stream-chunks/decode.js'
import JsonLdSerializer from '../index.js'
import * as ns from './support/namespaces.js'

@@ -22,3 +23,3 @@ describe('@rdfjs/serializer-jsonld', () => {

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -37,3 +38,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -52,3 +53,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -69,3 +70,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -86,3 +87,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -101,3 +102,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -119,3 +120,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -137,3 +138,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -156,3 +157,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -181,3 +182,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -200,3 +201,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream.array(serializer.import(input))
const content = await chunks(serializer.import(input))

@@ -219,3 +220,3 @@ deepStrictEqual(content[0], jsonld)

const content = await getStream(serializer.import(input))
const content = await decode(serializer.import(input))

@@ -222,0 +223,0 @@ deepStrictEqual(JSON.parse(content), jsonld)

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