npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

atma

v0.15.23

Published

Atma.Toolkit

Downloads

944

Readme

Atma.js Toolkit

> npm install atma -g
# ...
> atma --help
> atma [action] [arg] [...] -KEY VALUE [...]
> atma [*.json | *.js | *.yml]
# Load Config and process
#   .json - JSON
#   .yml - yml
#   .js - JS Module, that exports tasks(s)

Embedded Actions

... some more, just run atma -help

To get help from cli for a particular action run $ atma actionName -help

Config

Configuration object consists from any number of actions/tasks you want to run.

Javascript sample

// Single action
module.exports = ActionObject;

// Multiple actions
module.exports = [ActionObject, ActionObject, /*..*/];

// Grouped actions
module.exports = {
    groupName: ActionObject, // [ActionObject]
    otherGroup: ActionObject, // [ActionObject]
    
    // optional    
    defaults: ['groupName']
}

/*
 * Normally, if you run `atma config.js` then all grouped actions will be started,
 * but if `defaults` property is used, then only that groups will be activated.
 * Also you can run any group with: 'atma config.js groupName'
*/

ActionObject

{
    action: 'NAME',
    // ... action configuration
}

If ActionObject is in a group, and that groupname has the name of existed action, then you can ommit 'action' property

module.exports = {
    copy: {
        // action: 'copy' - is not required
		files: {
			'filePath': 'destinationPath',
            // ...
		}
    }
}

Actions

build

Application Builder for (IncludeJS)[http://atmajs.com/include]

Features:

  • Combine javascript into a single file

    • extract all scripts from main HTML file
    • extract all nested scripts included with IncludeJS
    • preprocess javascript if coffeescript or any other supported loader is used
  • Combine style into a single file

    • extract all style links from main HTML file
    • extract all nested styles included with IncludeJS
    • copy images or fonts, when located not in a working directory (e.g. are referened)
    • preprocess css if less or any other supported loader is used
  • Combine templates into resulted HTML file

    • extract all nested IncludeJS loads and embed them into the HTML
{
    "action": "build"
    
    // <String> — HTML input file
    "file": "index.dev.html",
    
    // <Boolean> — run MinifyJS and clean-css
    "minify": true,
    
    // <Object> - optional — UglifyJS compressor settings. @default {global_defs: {DEBUG: false}}
    "uglify": {} 
    "jshint" : {
        "options" : Object // — JSHINT options
        "globals" : Object // — global variables. @default {"window": false, "document": false}
        "ignore"  : Object // — file names to ignore
    }
    "outputMain": "index.html" // — output name of a built html
    "outputSources": "build/"  // — directory of combined/copied resources
}

project-import

{
    action: "project-import"
}

Copy resources, that are used by current project, from referenced directories in .reference/* to .import directory

project-reference

{
    action: "project-reference"
}

Switch back from "project-import" to resource referencing

transpiler

{
	action: 'transpile',
	source: 'scripts/**.es6',
	extension: 'js'
}
# or many
{
	action: 'transpile',
	many:[
		{
			source: 'scripts/**.es6',
			extension: 'js'
		},
		{
			source: 'styles/**.less',
			extension: 'css'
		}
	]
}
atma transpile --source "scripts/**.es6" --extension js

Preprocess files and save at the same directory just with another extension. You can quickly transpile ES6 modules to ES5, LESS to CSS and so on.

To make transpiler work you have to install appropriate plugins: like Atma.Babel

**Watch files for changes: **

atma transpile --source "scripts/**.es6" --extension js --watch
# Have you set settings to configuration file?
atma run MyTranspiles --watch

shell

{
    action: "shell",

    /* Commands: Array or String */
    command:  [
        "cmd /C copy /B index.html c:/app",
        "cmd /C copy /B index.build/ c:/app/index.build",
        // ... other commands
    ]

}

Execuate shell commands

custom

{
    action: "custom",
    script: "scriptPath.js"
}

Or from CLI

> atma custom scriptPath

Custom script should export process(config, done) function

// scriptPath.js

include.exports = {
    process: function(config, done){
        // config is current ActionObject - it can contain additional information
        // for a script

        // do smth. and call done if ready
        done(/* ?error */);
    }
}

@IMPORTANT

/*
    Any require(module) could also be resolved from global npm directory

    Example, you have installed jQuery globally - > npm install jquery -g
    and you can use it from the script as if it was installed in a directory, where
    scriptPath.js is located.

    var jquery = require('jquery');
    This is perfect for a cli scripting.

    Also you can use IncludeJS API here - as io.File:

    var content = new io.File('someTxt').read();

    new io.Directory().readFiles('*.txt).files.forEach(function(file){
        var txt = file.read() + '...';

        new io.File('path').write(txt);
    });
*/

HTTP Server

$ atma server --help

Start http(s) server in current working directory.

atma [action] -KEY VALUE

> atma server -port 5500

Reference (Symbolic Links)

{
    "action": "reference"
    "path": directory path || name of a project from globals.txt
    "name": reference name /* optional @default directory name*/
}
> atma reference atmajs

Creates symbolic link in "%current directory%/.reference" folder

gen

Scaffolding

{
    action: "gen",
    name: "name"
}
> atma gen [name]

Templates:

  • starter - MaskJS/mask.bindings/jmask/mask.compo/IncludeJS/Ruqq/jQuery
  • compo - creates component template .js/.css/*.mask : ```> atma template compo desiredName"
  • server - create node.js bootstrap project
  • todoapp - creates todomvc sample application

You can create any other templates - just put all required files to: %npm-global-directory%/node_modules/atma/template/%YourTemplateName%

Download Atma Libraries

> atma atma-clone
# only primary libraries are cloned from github, to clone all:
> atma atma-clone --all

Global Projects and default routes:

> atma globals

Sample:


projects:
    atma: 
        path: "file:///c:/Development/atma/"

defaultRoutes:
    atma_lib: 		"{atma}/{0}/lib/{1}.js"
    atma_ruqq: 		"{atma}/ruqq/lib/{0}.js"
    atma_compo: 	"{atma}/compos/{0}/lib/{1}.js"