Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global Opal, Asciidoctor, ASCIIDOCTOR_JS_VERSION */
const Opal = require('asciidoctor-opal-runtime').Opal
// Node module
;(function (root, factory) {
module.exports = factory
}(this, function (moduleConfig) {
//{{asciidoctorCode}}
//{{asciidoctorAPI}}
//{{asciidoctorVersion}}
/**
* Get Asciidoctor.js version number.
*
* @memberof Asciidoctor
* @returns {string} - returns the version number of Asciidoctor.js.
if (typeof Opal === 'undefined' && typeof module === 'object' && module.exports) {
Opal = require('asciidoctor-opal-runtime').Opal
}
if (typeof Opal === 'undefined') {
//{{opalCode}}
}
// UMD Module
(function (root, factory) {
if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory
} else if (typeof define === 'function' && define.amd) {
// AMD. Register a named module.
define('asciidoctor', ['module'], function (module) {
const includeHttpsSpec = require('../share/asciidoctor-include-https-spec')
const semVer = require('../share/semver')
const config = {
runtime: {
platform: 'node',
engine: 'v12',
framework: 'lollipop'
}
}
const isWin = process.platform === 'win32'
const asciidoctor = require('../../build/asciidoctor-node.js')(config)
const Opal = require('asciidoctor-opal-runtime').Opal // for testing purpose only
const packageJson = require('../../package.json')
const asciidoctorCoreSemVer = semVer(asciidoctor.getCoreVersion())
const testOptions = {
platform: 'Node.js',
baseDir: path.join(__dirname, '..', '..'),
coreVersion: asciidoctorCoreSemVer
}
shareSpec(testOptions, asciidoctor, expect)
includeHttpsSpec(testOptions, asciidoctor, expect)
function fileExists (path) {
try {
fs.statSync(path)
return true