
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@matrix-io/matrix-lite-nfc
Advanced tools
MATRIX Lite NFC JS is an npm package that allows users of varying skill levels to easily program NFC with their MATRIX Creator.
Install matrix-hal-nfc to use this library.
Download and install the latest version of Node.js, using nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
. ~/.bashrc
nvm install node
mkdir myApp
cd myApp
npm init -y
npm install @matrix-io/matrix-lite-nfc --save
View the examples folder!
const nfc = require("@matrix-io/matrix-lite-nfc");
When a read or write function completes, it will return a status code to indicate the result. nfc.Status
returns a string of what that number means.
nfc.status(/*number*/);
There can only be one instance of NFC reading. This is a hardware limitation that will not change.
// Configure what you want to read
let options = {
rate: 100, // Read loop speed (Milliseconds)
// At least 1 read options is required. Less options -> faster reading!
info: true, // Generic information for any NFC tag
pages: true, // All page data
page: 0, // A single page(faster than pages)
ndef: true // All NDEF data
}
// Start the loop
nfc.read.start(options, (code, tag) => {
// code: NFC activation status
// tag : Object with requested NFC data
});
nfc.read.stop();
An NFC constructor that represents an NDEF message. There are 2 uses for this class.
// Create an empty NDEF message
let msg = new nfc.message();
// Add NDEF Records to message
msg.addUriRecord("https://community.matrix.one");
msg.addUriRecord("tel:+14085551212");
msg.addTextRecord("Hello World");
msg.addTextRecord("Hola Mundo", "es");
msg.addMimeMediaRecord("text/json", '{"answer": 42}');
// You then pass msg into nfc.write.message(msg);
nfc.read.start({ndef:true}, (code, tag) => {
// You can create a new NDEF message from a scanned tag.
msg = new nfc.message(tag.ndef.content);
// Once created, you can read any known NDEF record.
console.log(msg.getRecords());
// or
console.log(msg.getRecord(0));
// You see the number of records with
// msg.getRecordCount();
});
Writing to an NFC tag should normally be done inside the read loop.
let msg = new nfc.message();
msg.addUriRecord("https://community.matrix.one");
nfc.write.message(msg).then((codes)=>{
// codes.activation : NFC activation status
// codes.write : NFC write status
});
nfc.write.erase().then((codes)=>{
// codes.activation : NFC activation status
// codes.write : NFC write status
});
Be careful when writing to a page. You can accidentally lock your NFC tag!
let page_index = 25; // page you want to overwrite
let page_byte = [48,45,59,21]; // Array of numbers that represents a byte
nfc.write.page(page_index, page_byte).then((code)=>{
// codes.activation : NFC activation status
// codes.write : NFC write status
});
Download the repository.
git clone https://github.com/matrix-io/matrix-lite-nfc-js
Install all dependencies.
npm install
You can now import the module into any .js
file.
const nfc = require("./PATH_TO_NFC_JS");
Use the following command when you need to compile any new C++ changes.
npm run build
FAQs
> Read and Write to NFC tags with a MATRIX Creator!
The npm package @matrix-io/matrix-lite-nfc receives a total of 2 weekly downloads. As such, @matrix-io/matrix-lite-nfc popularity was classified as not popular.
We found that @matrix-io/matrix-lite-nfc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.