Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Something like TIMEX3 in JavaScript.
This should be divided into 2 libraries:
npm install epic
TODO browser version.
There are Time
and Period
objects. Periods can have start and/or end times, and/or durations. Time is fuzzy. There is also the Unit
object.
The api should look something like this:
var epic = require('epic');
assert.equal(
epic.annotate('I went to school the day before yesterday...')
, 'I went to school <time>the day before yesterday</time>...'
);
epic.period({hours: 12}).toInt();
epic.hours(12).toInt();
Internals of the API
var epic = require('epic')
, Period = epic.Period
, Interval = epic.Interval
, Instant = epic.Instant;
// If you add this period to the 1st February (ISO) then you will get the 1st March.
// If you add the same period to the 1st March you will get the 1st April.
// But the duration added (in milliseconds) in these two cases is very different.
var period = new Period({months: 1});
var instant = Instant.parse('Feb 1, 2012');
instant.add(period);
instant.toString(); // "Mar 1, 2012"
// more complicated
// this says the winter solstice is on Dec 21, 2012,
// sometime between 6:00pm and 11:59pm (just made those numbers up)
var winterSolstice = new Interval(
new Instant('Dec 21, 2012 at 6:00pm'),
new Period({hours: 6}) // better name is "Duration"
);
// then you could go to next years winter solstice:
winterSolstice.add(Period.years(1))
// and it should be Dec 21, 2013 from 6pm - 11:59pm
Then some BC calculations:
var originOfAgriculture = epic.parse('10,000 BCE');
// which you could manually set up like this (but would have to know the internals of how BCE is handled)
var originOfAgriculture = new Time();
originOfAgriculture.subtract(new Period({years: 2012})).subtract(new Period({years: 10000}));
// there should be better ways to do this.
http://mail-archives.apache.org/mod_mbox/xml-xalan-dev/201204.mbox/%3C4F8B913C.6010106@e-z.net%3E
Ideas
// 1 million years ago
var mya = new Time({years: -1000000});
var mya = new Time(new Period({years: -1000000}));
// periods can have start and end dates, or they don't have to.
var triassicPeriod = new Period(new Time({years: -(250 * 1000000)}, new Time({years: -(200 * 1000000)});
triassicPeriod.startTime.add(new Period({years: 10}));
var triassicPeriod = new Period(new Time(-250), new Time(-200), new Unit('mya'));
var triassicPeriod = new Period(new Time(-250, new Unit('ma')), new Time(200, new Unit('ma')));
// maybe "unit" specifies the default operator or something
var triassicPeriod = new Period(new Time(-250, 'mya'), new Time(-200, 'mya'));
triassicPeriod.startTime.add(100)
var extinction = new Time(65, 'mya');
// how many years after the triassic period?
var periodBetween = new Period(triassicPeriod.endTime, extinction);
var millionYearsAfter = periodBetween.duration('ma'); // 200 - 65 = 135 ma
var yearsAfter = periodBetween.duration('years'); // 200 - 65 = 135 ma
This should print the date in a standard format that can be saved to a database. Some ideas are: (TODO)
John left by the time he left
John left by the time he ate
John ate by the time he left
John left by the time he ate
April is usually wet. generic
I was born on a Tuesday. indefinite
I had swimming classes on every Tuesday in 1999. gapped interval
Winter 1999 was extremely severe. vague
We got married about three years ago. approximate
The first three days of every month are always the busiest. set of intervals
The movie is two hours long. unanchored interval
She left five days after he came back. event-dependant
Category Examples
Adverbs simultaneously, currently, lately, today, yesterday, tomorrow
Frequency
Adverbs
a lot, always, ever, frequently, hardly ever, never, normally, occasionally,
often, frequently, rarely, sometimes, usually, hourly, daily, weekly or
monthly
Prepositional
Phrase
on Monday, at 5 o'clock, for one hour, in January, over many years,
during the weekend, after the meeting, before 8pm, between 11am and
1pm, by Monday morning, since 1978, until January 2006, from 1939 to
1945, within one hour, following the meeting
Postpositional
Phrase
five months ago, five months hence, five months on, the whole night
through
Other Adverbial Phrases: later than ever before, at least five years, all spring, on Tuesday at noon
Adverbial Clause: when she saw the snake, as soon as I have any news
Noun Phrase coming weeks, a beautiful morning, cold winters
John visited his parents twice in two years.
John learnt Japanese for half an hour every morning for a month.
John washed cars from morning till night from June till August.
John had arrived on Tuesday at noon.
On Tuesday, John had arrived at noon.
Last week, John had arrived 3 days ago.
John had arrived at noon on Tuesday.
John had arrived 3 days ago last week.
Category Lexical Triggers Non-Triggers
Noun minute, afternoon, midnight, day,
night, weekend, month, summer,
season, quarter, year, decade, cen-
tury, millennium, era, semester, fu-
ture, past, time, period, point
instant, jiy, episode, occasion,
tenure, timetable, reign, light year,
megawatt hour, lifetime, history
Adjective recent, former, current, future, past,
daily, monthly, biannual, semian-
nual, daytime, daylong, onetime,
ago, preseason, short-term, long-
term
early, ahead, next, subsequent, fre-
quent, perpetual, later, contempo-
rary, simultaneous, preceding, pre-
vious, existing, modern
Adverb currently, lately, hourly, daily,
monthly, ago (+ adverbial forms of
adjective triggers)
earlier, immediately, instantly,
forthwith, meanwhile, heretofore,
previously, next, beforehand, fol-
lowing, later, soon, sooner, shortly,
eventually, occasionally, once, still,
again, timely, whenever
Time
noun/adverb
now, today, yesterday, tomorrow
Number 3, three, third, sixties
Proper name Monday, January, New Year's Eve,
Washing's Birthday, Solstice
Pronouns that, then, it (only pronouns that
co-refer with a markable expression)
Time patterns 8:00, 12/02/2000, 1994, 1960s
that cold day the next day late last night
earlier that year next summer recent decades
numerous Saturdays more than a month no less than 60 days
just a year ago only one hour long its own future
the countrys future just a year ago only one hour long
five years old a few weeks later hours earlier
five days after he came back three decades ago the second-best quarter ever
months of renewed hostility a historic day for the European enterprise
nearly four decades of experience
Perhaps in the next two weeks.
How 'bout the afternoon of Monday the ninth?
Okay, how 'bout Tuesday March the sixteenth sometime after twelve o'clock pm?
9th Sep. 1987
an hour and 30 minutes
Tuesday and Thursday
Wednesday or Friday
4 o'clock
next month
exactly one minute ago
the 2nd Sunday in May
Wednesday from 3pm to 5pm
in the past 3 years
every 2 minutes and 30 seconds
from 3pm to 5pm
the rest of the year
sometime between 3pm and 5pm
other than Wednesday
less than 1 hour and 30 minutes
sometime before Sept. 9, 1987
sometime in 1987
January to March and May 2007
8am, except Mondays 9 am
the following month
the second Tuesday after Easter
two consecutive Sundays
today
three Mondays
all Mondays in every May
all Mondays in any May
any Monday in every May
the courses when the student has free time
We met in July last year
On Monday and Tuesday
three months earlier
from 3pm to 6pm
They are leaving on vacation two weeks from next Tuesday.
A major earthquake struck Los Angeles three years ago today.
This year’s summer was unusually hot.
Bacon tutored an English student some Thursdays in 1998.
She spent the following twelve years in various health care positions around Minnesota.
Ash Wednesday
Easter Sunday
Christmas Day
Adnan Pachachi, a onetime foreign minister who returned to Iraq on May 6 after 33 years in exile...
Yeah. I'm leaving on Monday and coming back on the thirtieth, so um
FAQs
Epoch
We found that epic 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.