Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
activity-streams
Advanced tools
Readme
A simple tool to facilitate handling and referencing activity streams and it's objects, cutting down on verbosity.
Designed to run in both node.js
and the browser
.
I am learning about JSON-LD and ActivityStreams2 as I write this library, so suggestions for improvement are very welcome.
$ npm install activity-streams
const ASFactory = require('activity-streams');
const ActivityStreams = ASFactory({
failOnUnkownObjectProperties: false // default
});
<script src="http://example.com/activity-streams.js"></script>
Once included in a web-page, the ActivityStreams
base object should be on the global scope, with the sub-properties ActivityStreams.Object
and ActivityStreams.Stream
.
const ActivityStreams = ASFactory();
ActivityStreams.Object.create({
'@id': 'irc://exampleUser@irc.freenode.net',
'@type': "person",
displayName: 'Example User',
url: "http://activitystrea.ms",
image: {
url: "http://activitystrea.ms/avatar.jpg",
mediaType: "image/jpeg",
width: 250,
height: 250
}
});
ActivityStreams.on('activity-object-create', function (obj) {
console.log('this object was just created: ', obj);
});
ActivityStreams.Object.create({
'@id': 'irc://irc.freenode.net/activitystreams',
'@type': "chatroom",
displayName: '#activitystreams'
});
const exampleUser = ActivityStreams.Object.get('irc://exampleUser@irc.freenode.net');
// ... returns:
// {
// '@id': 'irc://exampleUser@irc.freenode.net',
// '@type': "person",
// displayName: 'Example User',
// url: "http://activitystrea.ms",
// image: {
// url: "http://activitystrea.ms/avatar.jpg",
// mediaType: "image/jpeg",
// width: 250,
// height: 250
// }
// }
ActivityStreams.Stream({
'@context': 'send',
actor: 'irc://exampleUser@irc.freenode.net',
object: {
'@type': "message",
content: "hello world!"
},
target: 'irc://irc.freenode.net/activitystreams'
});
// ... returns:
// {
// '@context': 'send',
// actor: {
// '@id': 'irc://exampleUser@irc.freenode.net',
// '@type': "person",
// displayName: 'Example User',
// url: "http://activitystrea.ms",
// image: {
// url: "http://activitystrea.ms/avatar.jpg",
// mediaType: "image/jpeg",
// width: 250,
// height: 250
// }
// },
// object: {
// '@type': "message",
// content: "hello world!"
// },
// target: {
// '@id': 'irc://irc.freenode.net/activitystreams',
// '@type': "chatroom",
// displayName: '#activitystreams'
// }
// }
FAQs
A simple tool to facilitate handling and referencing activity streams without unnecessary verbosity
The npm package activity-streams receives a total of 69 weekly downloads. As such, activity-streams popularity was classified as not popular.
We found that activity-streams demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.