Closed LinusU closed 9 years ago
:+1:
While it is a strange syntax, it is in place due to the module being able to be consumed client-side as well. At the time of development, there wasn't a better way. Going to do an update to address this soon.
Been really behind and finally getting around to this. This will be a part of v1.1 or v2 shortly as there are other items changes coming with the client-side aspect of things too.
Updated package to v2.0.0 which addresses this. The usage is now as follows:
var luhn = require("luhn");
var is_valid = luhn.validate("number");
Hi,
When using this module from Node.js it feels very strange to do
require('luhn').luhn
. All the other libraries is justrequire('name')
.Please allow the following code to work: