
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@georges-tech/tardis
Advanced tools
Temporal property implementation for reading historized data.
npm install @georges-tech/tardis
You create a Tardis service through createHistoryService
by providing an array of documents that must contain
the following properties :
/**
* Date at which the configuration starts to be valid
*/
effective_date: Date;
/**
* Date at which the new configuration has been created
*/
known_at: Date;
/**
* Optional end date for limited time configurations
*/
end_date?: Date;
You can add as much properties as you like, depending on your use case, that will be returned by services.
Documents may contain a computed end_date
, being the next effective document date if it exists. Otherwise, it
is undefined
.
While creating the service, you can provide a date to work on the related timeline.
import tardis from '@georges-tech/tardis';
const documents = [{
effective_date: new Date('2020-01-01'),
known_at: new Date('2020-05-01'),
data: {
value: 'old',
}
}, {
effective_date: new Date('2020-03-01'),
known_at: new Date('2020-10-01'),
data: {
value: 'new',
}
}]
const historyService = tardis.createHistoryService({ documents });
const januaryConfiguration = historyService.getConfigurationAtDate({ date: new Date('2020-01-03') });
// januaryConfiguration.data.value = 'old'
// januaryConfiguration.end_date = new Date('2020-03-01')
const mayConfiguration = historyService.getConfigurationAtDate({ date: new Date('2020-05-03') });
// mayConfiguration.data.value = 'new'
// mayConfiguration.end_date = undefined
import tardis from '@georges-tech/tardis';
const documents = [{
effective_date: new Date('2020-01-01'),
known_at: new Date('2020-05-01'),
data: {
value: 'old',
}
}, {
effective_date: new Date('2020-03-01'),
known_at: new Date('2020-10-01'),
data: {
value: 'new',
},
{
effective_date: new Date('2020-04-01'),
known_at: new Date('2020-12-01'),
data: {
value: 'new 2',
}
}]
const historyService = tardis.createHistoryService({ documents, date: new Date('2020-11-01') });
const januaryConfiguration = historyService.getConfigurationAtDate({ date: new Date('2020-01-03') });
// januaryConfiguration.data.value = 'old'
// januaryConfiguration.end_date = new Date('2020-03-01')
const mayConfiguration = historyService.getConfigurationAtDate({ date: new Date('2020-05-03') });
// mayConfiguration.data.value = 'new'
// mayConfiguration.end_date = undefined
// Here we keep the configuration known on 01/10 because on the given date we did not yet know the "new2" configuration
FAQs
Temporal property implementation for reading historized data
The npm package @georges-tech/tardis receives a total of 172 weekly downloads. As such, @georges-tech/tardis popularity was classified as not popular.
We found that @georges-tech/tardis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.