Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
ampersand
Advanced tools
Readme
Part of the Ampersand.js toolkit for building client-side applications.
Lead Maintainer: Drew Fyock
The idea behind the CLI is not to solve all your problems and write all your code, but to help you with the tedious parts of building an app, which is what computers are supposed to help us with.
npm install -g ampersand
Just, cd
into whatever directory you normally put your projects in and just run ampersand
.
The CLI will walk you through some basic questions, and kick out an app that runs out of the box.
It's meant to be a loose guide, not an edict. Just delete whatever isn't relevant.
ampersand gen {{type}}
Type can be form
, view
, model
or collection
.
You can use the CLI to generate a model and collection for that model. If you already know what the JSON is going to look like you can pipe it into the generator to create a model with matching properties.
On a Mac, if you've copied some JSON to your clipboard you can do this from anywhere within your project folder:
pbpaste | ampersand gen model MyModel
And it'll kick out two files in your models folder (which is configurable, see below):
my-model.js
my-model-collection.js
And it will create the properties in the JSON object as model properties.
Don't worry, nothing will be overwritten unless you use the the --force
(or -f
) option
You can also use a model to generate the starting point of a form-view for editing that model.
ampersand gen form ./path/to/your/model.js
It will create a form view in your /client/forms
folder.
Nothing will be overwritten unless you use the the --force
(or -f
) option, so it's safe to just experiment.
The cli looks for config options from a number of sources, starting with default, applying configs from a .ampersandrc
in your home folder, then your project root, then by parsing option flags from stdin.
Those files can be JSON or ini format.
The available options and defaults are as follows:
framework
: default framework to be prompted with, options are express
or hapi
indent
: indent sizeview
: default templaterouter
: default templatemodel
: default templatepage
: default templatecollection
: default templateclientfolder
: name for the 'client' folderviewfolder
: name for the 'views' folderpagefolder
: name for the 'pages' foldermodelfolder
: name for the 'models' folderformsfolder
: name for the 'forms' foldercollectionfolder
: name for the collection folder - grouped with 'models' by defaultmakecollection
: whether to create collection when making a modelapproot
: if called without the 'gen' command build a new one, so we won't look for an application root. starts walking up folders looking for package.json
.quotes
: options are 'single' or 'double'{
"framework": "hapi",
"indent": 4,
"view": "",
"router": "",
"model": "",
"page": "",
"collection": "",
"clientfolder": "client",
"viewfolder": "views",
"pagefolder": "pages",
"modelfolder": "models",
"formsfolder": "forms",
"collectionfolder": "models",
"makecollection": true,
"approot": "",
"quotes": "single"
}
MIT
FAQs
CLI tool for generating single page apps a. la. http://humanjavascript.com
The npm package ampersand receives a total of 9 weekly downloads. As such, ampersand popularity was classified as not popular.
We found that ampersand demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.