You can dive it from the document step by step:
This driver is not part of the default package and must be installed separately by npm install msnodesqlv8@^2
- Above says
msnodesqlv8 is a driver, but to use this driver:
To use this driver, use this require syntax: const sql = require('mssql/msnodesqlv8').
- Above will reference the file: mssql/msnodesqlv8:
module.exports = require('./lib/msnodesqlv8')
- So look at the file mssql/lib/msnodesqlv8/index.js
const base = require('../base')
const ConnectionPool = require('./connection-pool')
const Transaction = require('./transaction')
const Request = require('./request')
- Then the file ./connection-pool.js finally required
msnodesqlv8 package:
const msnodesql = require('msnodesqlv8')
... ...
- Above
require('msnodesqlv8') will lookup and use the package you just installed.
It's like a chain, you grab the start(mssql/msnodesqlv8), but you got the end(msnodesqlv8) finally, the have similar names, but have different means.