An open source EAS library created by the community, for the community
You can install the entire EASjs library by running:
cd my-project
npm install @globaleas/easjs
To decode a SAME header using EASjs:
const samedecoder = require('@globaleas/easjs');
const header = "ZCZC-CIV-ADR-020173+0100-3441707-ERN/LB-";
const decoder = samedecoder(header);
console.log(decoder);
Output:
{
organization: 'The Civil Authorities have issued ',
event: 'Administrative Message',
locations: 'Sedgwick, KS',
timing: { start: '5:32 PM', end: '6:32 PM' },
sender: 'ERN/LB',
formatted: 'The Civil Authorities have issued a Administrative Message for Sedgwick, KS; beginning at 5:32 PM and ending at 6:32 PM. Message from ERN/LB'
}
To grab a specific value from the decoded data:
const samedecoder = require('@globaleas/easjs');
const header = "ZCZC-CIV-ADR-020173+0100-3441707-ERN/LB-";
const decoder = samedecoder(header);
console.log(decoder.event);
Output:
"Administrative Message"
For support or queries, open a issue here on GitHub or email developers@globaleas.org