Skip to content

WebReflection/buffer-points

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

buffer-points

build status Coverage Status

A module that buffers code points before flushing these as single char.

import bufferPoints from 'buffer-points';

const encoder = new TextEncoder;
const decoder = new TextDecoder;

const buffered = bufferPoints(buffer => {
  console.log(escape(decoder.decode(buffer)));
});

const test = encoder.encode('🤷‍♂️');
console.log(buffered(test), test.length, 'bytes parsed');

/*
%uD83E%uDD37
%u200D
%u2642
%uFE0F
13 13 bytes parsed
*/

That's it.

About

A module that buffers code points before flushing these as single char.

Resources

License

Stars

Watchers

Forks

Packages

No packages published