https://github.com/don/ndef-js
Library to create and parse NDEF messages
https://github.com/don/ndef-js
Last synced: about 1 year ago
JSON representation
Library to create and parse NDEF messages
- Host: GitHub
- URL: https://github.com/don/ndef-js
- Owner: don
- License: other
- Created: 2013-06-15T04:08:03.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T09:22:45.000Z (about 6 years ago)
- Last Synced: 2025-03-17T20:11:23.889Z (about 1 year ago)
- Language: JavaScript
- Size: 66.4 KB
- Stars: 23
- Watchers: 6
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
Library to create and parse NDEF messages.
ndef = require('ndef');
message = [
ndef.textRecord("hello, world")
];
bytes = ndef.encodeMessage(message);
// do something useful with bytes: write to a tag or send to a peer
records = ndef.decodeMessage(bytes);
ndef.text.decodePayload(records[0].payload);
// prints 'hello, world'
See the [examples](https://github.com/don/ndef-js/blob/master/examples) directory and the [mifare classic examples](https://github.com/don/ndef-mifare-classic-js/blob/master/examples) for more information on creating and decoding messages.
See the [phonegap-nfc documentation](https://github.com/chariotsolutions/phonegap-nfc#ndef) for additional info.