This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function echo(param: string): string { | |
return param; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = (event, context, callback) => { | |
const result = event.num * 2; | |
callback(null, result); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('lodash'); | |
exports.handler = (event, context, callback) => { | |
const result = _.range(1, event.num + 1); | |
callback(null, result); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const BUCKET_NAME = 'your-s3-bucket-name'; | |
const s3 = new AWS.S3(); | |
exports.handler = (event, context, callback) => { | |
const { name, body } = event; | |
s3.putObject({ | |
Bucket: BUCKET_NAME, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "apex-typescript-example", | |
"description": "", | |
"memory": 128, | |
"timeout": 5, | |
"role": "your-iam-role", | |
"handler": "lib.default", | |
"environment": {}, | |
"hooks": { | |
"clean": "rm -rf lib", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: './src/index.ts', | |
target: 'node', | |
output: { | |
path: path.join(process.cwd(), 'lib'), | |
filename: 'index.js', | |
libraryTarget: 'commonjs2', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es6", | |
"outDir": "output", | |
"sourceMap": false, | |
"experimentalDecorators": true, | |
"allowJs": true, | |
"moduleResolution": "node", | |
"baseUrl": ".", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('starting function'); | |
export default (e, ctx, cb) => { | |
console.log('processing event: %j', e); | |
cb(null, { hello: 'world' }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "Hello function", | |
"runtime": "nodejs6.10", | |
"memory": 128, | |
"timeout": 5, | |
"role": "your-iam-role" | |
} |
OlderNewer