Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
/ leftenant Public archive

Lit. "placeholder"; I quickly, quietly succeed at everything

License

Notifications You must be signed in to change notification settings

juristat/leftenant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leftenant

Lit. "placeholder". I quickly and quietly succeed at any task you give me. Just call me. I can be almost anything to anybody, but not everything to everybody. That's ok, call me over and over if you need.

"almost anything"

I can be these things:

  • synchronous function: leftenant(...args)
  • callback function: leftenant(...args, function(err, result) {})
  • Promise function:
  • await leftenant() (but leftenant doesn't require async/await support)
  • leftenant().then(...)
  • Promise.resolve(leftenant())
  • EventEmitter
  • Duplex stream
  • Connect/Express/Koa 2 middleware: app.use(leftenant)

"not everything"

Don't try to use me as an EventEmitter and a stream at the same time. Call me twice for that.

sugar (well, more sugar)

You can say leftenant.make(...keys) to get an object where all the specified keys are leftenant itself. Or, say leftenant.make({key1: boolean, key2: boolean, ...}); then you'll get an object with those keys, but if the key's boolean value was truthy, it'll be an instantiated leftenant() instead of just leftentant.

legal

Copyright 2016 Datanalytics, Inc. d/b/a Juristat. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Lit. "placeholder"; I quickly, quietly succeed at everything

Resources

License

Stars

Watchers

Forks

Packages

No packages published