
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
data-text-mapper
Advanced tools
The data-text-mapper contains some utility functions to convert a structured text with link, tag and scope metadata into a combined plain text or html. As well it's made for encode an decode again.
An example use case where it was made for, is to convert structured data given e.g. in ics event data to simplier google events by encoding the metadata inside the description.
const data: TextWithData = {
description: "Lorem Ipsum",
url: "https://www.domain.com/",
tags: ["One", "Two", "Three"],
scopes: ["One", "Two", "Three"],
};
dataToText(data);
returns
Lorem Ipsum
https://www.domain.com/
#One #Two #Three @One @Two @Three
Transforms back the given html to a data object.
const data: TextWithData = {
description: "Lorem Ipsum",
url: "https://www.domain.com/",
tags: ["One", "Two"],
scopes: ["Three", "Four"],
};
dataToHtml(data)
returns
<p class="description">Lorem Ipsum</p>
<p class="link"><a href="https://www.domain.com/">https://www.domain.com/</a></p>
<p class="taxonomy"><span class="tag">#One</span> <span class="tag">#Two</span> <span class="scope">@Three</span> <span class="scope">@Four</span></p>
Transforms back the given html to a data object.
For more details and edge case description please take a look into the unit tests.
Not all functions are written that clean as expected. Improvements will we tracked in github issues. Please mention that 'data-text-mapper' is part of the upcoming 'events-api'.
FAQs
Extracts data from text and generates text with data included.
We found that data-text-mapper 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.