Home
Tutorials
Getting Started
Overview
Installing backendjs
Creating a Web Server
Creating a module
Next steps
Reference
Project Structure
Modules
NPM packages as modules
Message passing
Dependencies
Middleware
Configuration
Config sources
Environment variables
Backend library development (Mac OS X, developers)
Using the API Module
The router
Body parser
Multipart uploads
CORS
CSRF protection
Rate limiter
Validate
Routing (rewrite & redirect)
Static files
Putting it together
Quick reference
Using the Library Module
Quick categories
1 🔍 Type checking
2 ✅ Validation & type coercion
3 🌊 Flow control
4 🔤 Strings & conversions
5 🗂️ Objects & arrays
6 📅 Date & time
7 📁 File system
8 🌐 HTTP fetch
9 🖥️ Process execution
10 🖥️ System info
11 🔐 Crypto & secrets
12 #️⃣ Hashing
13 🆔 UUID & Snowflake
14 🍪 JSON / Config / Cookie parsing
15 🍔 i18n
16 🧠 Caching & pools
16 🔁 Respawn / crash-loop throttler
17 🆕 Safe error creation
18 🔧 Misc helpers
Quick reference table
Tips
Using the Database Layer
Define your table
Create and update tables
Insert records
Read records
Query records
Operators
List/array operators
Combine conditions
Update records
Delete records
Pagination
Streaming large datasets
Batch operations
Caching
Table aliases
Field visibility (cleanup)
Raw SQL
Validation errors
Quick reference
Using the AWS Module
How credentials work
Loading external config
DynamoDB
S3 storage
Message queues (SQS)
Compute: EC2, ECS, and SSM
Monitoring: CloudWatch
Notifications: SNS and SES
DNS: Route53
Secrets, certificates, and Bedrock
Other databases: RDS Data API
Calling a service directly
Per-service tuning
Using the Job Queue
Anatomy of a job
A complete module with a job
Queues
Submitting jobs
Job options
Cancellation
Cron / scheduled jobs
Module hooks (lifecycle)
Worker configuration
Running locally vs. remote
Job format validation
Complete example: background order processing
Quick reference
Using the Users Module
Enabling the module in config
CRUD operations
Shell commands
Password hashing
Cookie session authentication
API token authentication
MFA / TOTP
Middleware handlers
Authorization (ACL)
Rate limiting
A complete configuration
Caching
How the module fits the test suite
Quick reference
The bkjs tool
Environment
Functions
Extending bkjs tool
Modules
api
alimiter
createServer
init
limiter
shutdown
validate
writeAccesslog
api/acl
isAllowed
isDenied
isMatched
reset
api/passkey
api/session
clear
create
getCookieOptions
parse
setCookie
verify
api/token
parse
prepare
verify
api/users
aadd
acheckSecret
add
adel
aget
alogin
alogout
aupdate
checkSecret
clearup
del
get
isUuid
login
logout
prepareMFA
prepareSession
prepareTOTP
update
verifySession
verifyToken
api/ws
broadcast
notify
app
addModule
ainit
arunMethods
astart
astop
checkConfig
createRepl
describeArgs
exit
getExtension
getMethodContext
getMimeType
init
isOk
killBackend
loadModules
loadPackages
origin
parseArgs
parseConfig
processArg
processArgs
processEnvArgs
runMethod
runMethods
setHome
setHost
setLogInspect
setRole
sortModules
start
startRepl
stop
watchTmp
aws
aqueryEC2
aqueryECS
aqueryEndpoint
aqueryIAM
aqueryS3
aquerySQS
aquerySTS
aqueryService
aqueryService
batchGetSecretValue
bedrockConverse
bedrockInvoke
configure
configureJob
configureServer
cwGetMetricData
cwListMetrics
cwPutLogEvents
cwPutMetricAlarm
cwPutMetricData
cwlFilterLogEvents
ddbBatchExecuteStatement
ddbBatchGetItem
ddbBatchWriteItem
ddbCreateTable
ddbDeleteItem
ddbDeleteTable
ddbDescribeTable
ddbDescribeTimeToLive
ddbExecuteStatement
ddbExecuteTransaction
ddbExportTableToPointInTime
ddbGetItem
ddbListTables
ddbPutItem
ddbQueryTable
ddbRetryOnError
ddbScanTable
ddbSigner
ddbTable
ddbTransactWriteItems
ddbUpdateItem
ddbUpdateTable
ddbUpdateTimeToLive
ddbWaitForTable
ec2AfterRunInstances
ec2AssociateAddress
ec2AttachNetworkInterface
ec2CreateImage
ec2CreateTags
ec2DeregisterImage
ec2DescribeInstances
ec2DescribeSecurityGroups
ec2DescribeSubnets
ec2PrepareInstance
ec2RunInstances
ec2WaitForInstance
ecsDescribeTasks
ecsPrepareTask
ecsRunTask
ecsTaskProtection
elb2DeregisterInstances
elb2RegisterInstances
fetch
fromDynamoDB
getInstanceCredentials
getInstanceDetails
getInstanceInfo
getInstanceMeta
getInstanceMetaToken
getSecretValue
getServiceCredentials
getServiceEndpoint
getServiceOptions
getServiceRegion
getTaskDetails
lambdaEventsProxySQS
lambdaInvoke
lambdaProxyAPIGateway
listCertificates
parseError
parseXMLResponse
queryACM
queryAS
queryCFN
queryCW
queryCWL
queryComprehend
queryDDB
queryEC2
queryECR
queryECS
queryELB2
queryElastiCache
queryEndpoint
queryEvents
queryIAM
queryRdsData
queryRekognition
queryRoute53
queryRoute53Domains
queryS3
querySES
querySNS
querySQS
querySSM
querySTS
querySecrets
queryService
queryTranscribe
rdsDataExecute
readConfig
readCredentials
readCredentialsProfile
retryOnError
route53Change
route53Create
route53Get
route53List
s3CopyFile
s3GetFile
s3List
s3ParseUrl
s3Proxy
s3PutFile
sesSendEmail
sesSendRawEmail
sesSendRawEmail2
signQuery
signS3
signer
snsConfirmSubscription
snsCreatePlatformEndpoint
snsCreateTopic
snsDeleteEndpoint
snsDeleteTopic
snsListTopics
snsPublish
snsSetEndpointAttributes
snsSetSubscriptionAttributes
snsSetTopicAttributes
snsSubscribe
snsUnsubscribe
sqsReceiveMessage
sqsSendMessage
sqsSendMessageBatch
ssmGetParametersByPath
ssmSendCommand
ssmWaitForCommand
stsAssumeRole
toDynamoDB
uriEscape
uriEscapePath
cache
acheckLimiter
aclear
adel
aget
aincr
alimiter
alock
aput
astats
aunlock
checkConfig
checkLimiter
clear
createClient
del
get
getClient
incr
initClients
limiter
localLimiter
lock
put
shutdown
stats
unlock
color
color.contrast
color.darker
color.hex
color.hex2rgb
color.hsl
color.hsl2rgb
color.lighter
color.luminance
color.negate
color.rluminance
color.rotate
color.yiq
mix
db
aadd
abatch
abulk
acacheColumns
acopy
acreate
acreateTables
add
adel
adelAll
adrop
aget
agetConfig
aincr
alist
applyPoolOptions
aput
aquery
ascan
asearch
aselect
asql
atransaction
aupdate
aupdateAll
aupgrade
batch
bulk
cacheColumns
checkCached
checkCapacity
cleanupResult
configTypes
configureCollectStats
convertError
convertRows
copy
create
createTables
del
delAll
describeTables
drop
existsPool
get
getCached
getCapacity
getColumn
getColumnType
getColumns
getConfig
getIndexColumns
getIndexes
getKeys
getPool
getPoolTables
getPools
getProcessRows
getQueryForKeys
incr
init
initColumns
initConfig
initConfigTable
initTables
list
paginatePage
parseNameOp
prepare
prepareColumn
prepareQuery
prepareValue
put
query
queryProcessSync
runProcessRows
scan
search
select
setConfig
setProcessColumns
setProcessRow
sql
transaction
update
updateAll
upgrade
events
aputEvent
processEvent
putEvent
subscribe
unsubscribe
files
acopy
adel
adetect
adetectAndStore
alist
aread
astore
aupload
copy
del
detect
detectAndStore
getContentDisposition
list
read
send
store
upload
image
image.clip
image.composite
image.convert
image.create
image.createBorder
image.createGradient
image.createImage
image.createOutline
image.createText
image.detect
image.mergeDefaults
image.metadata
image.padding
image.region
image.stats
image.stitch
ipc
broadcast
emitMsg
initServer
initWorker
newMsg
sendMsg
jobs
asubmit
cancel
isCancelled
isJob
loadCronjobs
markCancelled
scheduleCronjob
scheduleCronjobs
submit
subscribe
unsubscribe
lib
AhoCorasick
__
acheckSecret
aexecProcess
afetch
afindProcess
aprepareSecret
areadFile
areadFile
arrayEqual
arrayFlatten
arrayLength
arrayRemove
arrayUnique
arrayUpdate
aspawnProcess
autoType
base64ToJson
call
cidrRange
clock
clone
configParse
copyFile
cpuStats
daysInMonth
decodeURIComponent
decrypt
doWhilst
domainName
dropPrivileges
encodeURIComponent
encrypt
entityToText
escapeUnicode
everyParallel
everySeries
execProcess
extend
fetch
findFile
findFileFilter
findFileSync
findProcess
findWords
flatten
forEach
forEachItem
forEachLimit
forEachLine
forEachLineSync
forEachSeries
forEvery
forEveryLimit
forEverySeries
fromBase32
fromBase62
fromBase64url
gcStats
getArg
getArgInt
getHashid
getWorkers
getuid
hash
heapStats
inCidr
includes
inspect
int2ip
ip2int
isArg
isArray
isDST
isDate
isEmpty
isFunc
isMatched
isNumber
isNumeric
isObject
isPositive
isPrefixed
isRegExp
isSimilar
isString
isTimeRange
isTrue
isUnicode
isUuid
isWord
jsonFormat
jsonFormatPreset
jsonParse
jsonToBase64
killWorkers
loadLocale
localEpoch
log
lzCompress
lzDecompress
makePath
makePathSync
matchAllRegexp
matchRegexp
memoryStats
moveFile
murmurHash3
networkInterfaces
networkStats
newError
notifyWorkers
now
objGet
objIncr
objKeys
objMult
objSet
objSize
parallel
parseCookies
parseTime
phraseSplit
random
randomBytes
randomFloat
randomInt
randomNum
randomShort
randomUInt
randomUShort
readFile
readFileSync
replaceRegexp
sanitizePath
sanitizePath
series
sfuuid
shuffle
sign
sleep
sortByVersion
spawnProcess
spawnSeries
split
sprintf
statSync
strftime
stringify
suuid
testRegexp
testRegexpObj
textToEntity
textToXml
timingSafeEqual
toBase32
toBase62
toBase64url
toBool
toCamel
toCookie
toDate
toDigits
toDuration
toEmail
toFormat
toMap
toMilliseconds
toMtime
toNumber
toPercentEncoded
toPrice
toRFC3339
toRegexp
toRegexpObj
toSize
toSkip32
toString
toTemplate
toTitle
toUncamel
toUrl
toValue
toVersion
totp
traceError
trim
tryCall
tryCatch
tryLater
tryRequire
typeName
tzName
unescape
unicode2Ascii
unlink
unlinkPath
unlinkPathSync
unlinkSync
uuid
uuid
validBool
validFunc
validNumber
validPositive
validValue
validVersion
validate
watchFiles
weekDate
weekOfYear
whilst
wrap
writeLines
xmlParse
zeropad
ValidateOptions
lib/JWT
importPrivateKey
importPublicKey
sign
verify
lib/respawn
check
logger
debug
dev
dump
error
info
inspect
log
logger
none
registerLevel
setDebugFilter
setFile
setInspect
setLevel
setOptions
setSyslog
trace
warn
logwatcher
metrics
incr
take
toJSON
middleware/body
configureMiddleware
handle
middleware/cors
handle
middleware/csrf
configureMiddleware
handle
middleware/limiter
configureMiddleware
handle
middleware/multipart
configureMiddleware
handle
middleware/proxy
handle
proxy
middleware/routing
handle
middleware/static
configureMiddleware
configureMiddleware
handle
middleware/users
authorize
configureMiddleware
handle
handleToken
login
logout
profile
middleware/validate
configureMiddleware
handle
middleware/xray
handle
modules
push
configureModule
init
parseDevice
send
shutdown
queue
apublish
asubmit
checkConfig
createClient
getClient
initClients
listen
publish
purge
queue.apurge
queue.astats
shutdown
stats
submit
subscribe
unlisten
unsubscribe
sendmail
send
send
shell
fetch
runFile
stats
sql
column
create
createIndexes
delete
drop
expr
get
insert
limit
quote
select
time
update
updateExpr
upgrade
value
valueIn
where
where
stats
watcher
webscraper
run
Classes
Counter
DbPool
aquery
cacheColumns
cacheIndexes
closeDb
configure
convertError
exists
nextToken
openDb
prepare
prepareOptions
prepareQuery
query
shutdown
DbRequest
column
DynamoDBPool
ElasticsearchPool
FakeTrace
FetchRequest
parseSetCookies
Histogram
Meter
PgPool
Pool
PostgresPool
RdsDataPool
RequestContext
appendHeader
cookie
destroy
emit
format
json
on
redirect
reply
runHooks
send
sendFile
setCookie
setHeader
setUrl
stat
var
Router
add
all
del
delete
find
get
handle
onFinish
patch
post
put
reset
split
use
walk
RqlitePool
SqlPool
nextToken
placeholder
prepare
prepareExpr
prepareUpdateExpr
query
SqlitePool
Timer
TokenBucket
configure
consume
equal
toArray
toJSON
toString
Trace
destroy
send
start
stop
toString
WebSocketRequest
_read
WebSocketResponse
end
LRUCache
CacheClient
applyOptions
applyReservedOptions
clear
close
del
get
incr
limiter
lock
put
stats
unlock
LocalCacheClient
RedisCacheClient
WorkerCacheClient
WebPushClient
EventBridgeQueueClient
JSONQueueClient
LocalQueueClient
NatsQueueClient
QueueClient
_poll_del
_poll_emit
_poll_get
_poll_run
_poll_run_item
_poll_update
group
listen
poll
purge
schedule
subject
submit
subscription
unlisten
RedisQueueClient
SNSQueueClient
SQSQueueClient
WorkerQueueClient
Global
ConfigOptions
DbConfigOptions
DbRequestColumn
DbRequestOptions
DbResultCallback
DbTable
DbTableColumn
Route
SESTransport
SendGridTransport
LocalQueueClient
module:queue
.
LocalQueueClient
Client that uses the local process or server process for jobs.
Constructor
new LocalQueueClient
()
Source:
lib/queue/local.js
,
line 16