Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

super3/streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

streams

Example Usage

This repo attempts to create a type-independent API for indexing chunks for searching.

const createChunk = require('./lib/createChunk');

const message = createChunk({
	"type": "message",
	"content": {
		"user": "Monty",
		"text": "Hello",
		"url": "http://telegram.com/"
	},
	"date": 1544551774794,
	"source": "telegram"
});

message.toTerms();
// [ 'Monty', 'Hello' ]

const text = createChunk({
	"type": "text",
	"content": "Hello, World",
	"date": 1544551774794,
	"source": "telegram"
});

text.toTerms();
// [ 'Hello, World' ]

API

Chunk

A chunk is a time-discrete event in a stream.

{
	"type": String,
	"content": Object,
    "date": Number,
    "source": String
}

Types

{
	"type": "text",
	"content": "Hello, World",
	"date": 1544551774794,
	"source": "telegram"
}
{
	"type": "message",
	"content": {
		"user": "Monty",
		"text": "Hello",
		"url": "http://telegram.com/"
	},
	"date": 1544551774794,
	"source": "telegram"
}

About

Nile.chat streams.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published